PNG  IHDR(2miPLTE^S9tRNSO :%ϰJ1轵 ןqU@ʤke^6ӒzxuZGE,ٖ|bIDATHǍv@DT45&39ȰAs\[Rsɏ@K8mȇ԰ਉB3x/Q'utjt[6l}J=ch'ɁA89'4-:ɳ_z:oZ݋Pmin/֋[ë&PD&_A?6|0z]QEإFSwh[&2-rV#B?ą wPrh^I?lIN%O{iTɃd+WOD=-}[ξ0w[i}6RbB+<  Mx5l:tᛰĂFPgey^(Cb t: 1f,|x YJF)/8pͅ3rk𖷋jm#`'2C[maepZҌ6vC/?BWIENDB`me', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title', 'term_description', 'the_title', 'the_content', 'the_excerpt', 'comment_text', 'single_post_title', 'list_cats'); $filters = array_combine($filters, $filters); $filters = apply_filters('zalomeni_filtry', $filters); foreach ($filters as $filter) { add_filter($filter, array($this, 'texturize')); // content filter } } } static function activate() { $required_php_version = '5.3'; if (version_compare(phpversion(), $required_php_version, '<')) die(str_replace(array("%1", "%2"), array($required_php_version, phpversion()), __("Plugin Zalomení vyžaduje PHP verze %1 nebo vyšší. Na tomto webu je nainstalováno PHP verze %2", "zalomeni"))); self::add_options(); } const default_prepositions = 'on'; const default_prepositions_list = 'k, s, v, z'; const default_conjunctions = ''; const default_conjunctions_list = 'a, i, o, u'; const default_abbreviations = ''; const default_abbreviations_list = 'cca., č., čís., čj., čp., fa, fě, fy, kupř., mj., např., p., pí, popř., př., přib., přibl., sl., str., sv., tj., tzn., tzv., zvl.'; const default_between_number_and_unit = 'on'; const default_between_number_and_unit_list = 'm, m², l, kg, h, °C, Kč, lidí, dní, %'; const default_spaces_in_scales = 'on'; const default_space_between_numbers = 'on'; const default_space_after_ordered_number = 'on'; const default_custom_terms = "Formule 1\nWindows \d\niPhone \d\niPhone S\d\niPad \d\nWii U\nPlayStation \d\nXBox 360"; static function add_options() { add_option('zalomeni_version', self::version); add_option('zalomeni_prepositions', Zalomeni::default_prepositions); add_option('zalomeni_prepositions_list', Zalomeni::default_prepositions_list); add_option('zalomeni_conjunctions', Zalomeni::default_conjunctions); add_option('zalomeni_conjunctions_list', Zalomeni::default_conjunctions_list); add_option('zalomeni_abbreviations', Zalomeni::default_abbreviations); add_option('zalomeni_abbreviations_list', Zalomeni::default_abbreviations_list); add_option('zalomeni_between_number_and_unit', Zalomeni::default_between_number_and_unit); add_option('zalomeni_between_number_and_unit_list', Zalomeni::default_between_number_and_unit_list); add_option('zalomeni_spaces_in_scales', Zalomeni::default_spaces_in_scales); add_option('zalomeni_space_between_numbers', Zalomeni::default_space_between_numbers); add_option('zalomeni_space_after_ordered_number', Zalomeni::default_space_after_ordered_number); add_option('zalomeni_custom_terms', Zalomeni::default_custom_terms); self::update_matches_and_replacements(); } private function update_plugin_version() { $registered_version = get_option('zalomeni_version', '0'); if ($registered_version == '0') return; if (version_compare($registered_version, self::version, '<')) { if (version_compare($registered_version, '1.3', '<')) { $old_options = get_option('zalomeni_options'); update_option('zalomeni_prepositions', $old_options['zalomeni_prepositions']); update_option('zalomeni_prepositions_list', $old_options['zalomeni_prepositions_list']); update_option('zalomeni_conjunctions', $old_options['zalomeni_conjunctions']); update_option('zalomeni_conjunctions_list', $old_options['zalomeni_conjunctions_list']); if (!version_compare($registered_version, '1.1', '<')) { // these options were introduced in version 1.1 update_option('zalomeni_abbreviations', $old_options['zalomeni_abbreviations']); update_option('zalomeni_abbreviations_list', $old_options['zalomeni_abbreviations_list']); update_option('zalomeni_space_between_numbers', $old_options['zalomeni_numbers']); } delete_option('zalomeni_options'); } self::add_options(); update_option('zalomeni_version', self::version); } } protected static $this_plugin; function add_settings_to_plugin_actions($links, $file) { // Add settings link to plugin list for this plugin if (!self::$this_plugin) self::$this_plugin = plugin_basename(__FILE__); if ($file == self::$this_plugin) { $settings_link = '' . __('Settings') . ''; array_unshift( $links, $settings_link ); // before other links } return $links; } function admin_init() { $this->update_plugin_version(); add_filter('plugin_action_links', array($this, 'add_settings_to_plugin_actions'), 10, 2); // link from Plugins list admin page to settings of this plugin register_setting('reading', 'zalomeni_prepositions'); register_setting('reading', 'zalomeni_prepositions_list'); register_setting('reading', 'zalomeni_conjunctions'); register_setting('reading', 'zalomeni_conjunctions_list'); register_setting('reading', 'zalomeni_abbreviations'); register_setting('reading', 'zalomeni_abbreviations_list'); register_setting('reading', 'zalomeni_between_number_and_unit'); register_setting('reading', 'zalomeni_between_number_and_unit_list'); register_setting('reading', 'zalomeni_space_between_numbers'); register_setting('reading', 'zalomeni_space_after_ordered_number'); register_setting('reading', 'zalomeni_spaces_in_scales'); register_setting('reading', 'zalomeni_custom_terms'); add_settings_section('zalomeni_section', $this->texturize(__('Nevhodná slova a zalomení na konci řádku', 'zalomeni')), 'Zalomeni::settings_section_description', 'reading'); add_settings_field('zalomeni_prepositions', __('Předložky', 'zalomeni'), 'Zalomeni::settings_field_checkbox', 'reading', 'zalomeni_section', array('option'=>'prepositions', 'description'=>"Vkládat pevnou mezeru za následující předložky.", 'toggle_list_read_only'=>true)); add_settings_field('zalomeni_prepositions_list', '', 'Zalomeni::settings_field_textlist', 'reading', 'zalomeni_section', array('option'=>'prepositions', 'description'=>"(oddělte jednotlivé předložky čárkou)")); add_settings_field('zalomeni_conjunctions', __('Spojky', 'zalomeni'), 'Zalomeni::settings_field_checkbox', 'reading', 'zalomeni_section', array('option'=>'conjunctions', 'description'=>"Vkládat pevnou mezeru za následující spojky.", 'toggle_list_read_only'=>true)); add_settings_field('zalomeni_conjunctions_list', '', 'Zalomeni::settings_field_textlist', 'reading', 'zalomeni_section', array('option'=>'conjunctions', 'description'=>"(oddělte jednotlivé spojky čárkou)")); add_settings_field('zalomeni_abbreviations', __('Zkratky', 'zalomeni'), 'Zalomeni::settings_field_checkbox', 'reading', 'zalomeni_section', array('option'=>'abbreviations', 'description'=>"Vkládat pevnou mezeru za následující zkratky.", 'toggle_list_read_only'=>true)); add_settings_field('zalomeni_abbreviations_list', '', 'Zalomeni::settings_field_textlist', 'reading', 'zalomeni_section', array('option'=>'abbreviations', 'description'=>"(oddělte jednotlivé zkratky čárkou)")); add_settings_field('zalomeni_between_number_and_unit', __('Jednotky a míry', 'zalomeni'), 'Zalomeni::settings_field_checkbox', 'reading', 'zalomeni_section', array('option'=>'between_number_and_unit', 'description'=>"Vkládat pevnou mezeru mezi číslovku a jednotku míry (měrné jednotky, měna apod., např. 5 m nebo 10 kg).", 'toggle_list_read_only'=>true)); add_settings_field('zalomeni_between_number_and_unit_list', '', 'Zalomeni::settings_field_textlist', 'reading', 'zalomeni_section', array('option'=>'between_number_and_unit', 'description'=>"(oddělte jednotlivé míry čárkou)")); add_settings_field('zalomeni_space_between_numbers', __('Mezery uprostřed čísel', 'zalomeni'), 'Zalomeni::settings_field_checkbox', 'reading', 'zalomeni_section', array('option'=>'space_between_numbers', 'description'=>"Pokud jsou dvě čísla oddělena mezerou, předpokládat, že se jedná o formátování čísla pomocí mezery (např. telefonní číslo 800 123 456) a nahrazovat mezeru pevnou mezerou, aby nedošlo k zalomení řádku uprostřed čísla.")); add_settings_field('zalomeni_space_after_ordered_number', __('Řadové číslovky', 'zalomeni'), 'Zalomeni::settings_field_checkbox', 'reading', 'zalomeni_section', array('option'=>'space_after_ordered_number', 'description'=>"Zabránit zalomení řádku za řadovou číslovkou; díky tomu nedojde k zalomení řádku uprostřed data (např. 1. ledna) a v podobných případech (19. ročník, 3. svazek, 5. kapitola apod.)")); add_settings_field('zalomeni_spaces_in_scales', __('Měřítka a poměry', 'zalomeni'), 'Zalomeni::settings_field_checkbox', 'reading', 'zalomeni_section', array('option'=>'spaces_in_scales', 'description'=>"Pevné mezery v měřítkách a poměrech (např. 1 : 50 000)")); add_settings_field('zalomeni_custom_terms', __('Vlastní výrazy', 'zalomeni'), 'Zalomeni::settings_field_custom_terms', 'reading', 'zalomeni_section'); if (get_option('zalomeni_matches') == '') { Zalomeni::update_matches_and_replacements(); } $this->add_update_option_hooks(); } static public function settings_field_checkbox(array $args) { echo( ' ' . Zalomeni::texturize(__($args['description'], 'zalomeni')) ); } static public function settings_field_textlist(array $args) { echo( ' ' . Zalomeni::texturize(__($args['description'], 'zalomeni')) ); } static public function settings_field_custom_terms() { echo( Zalomeni::texturize(__('Zde můžete uvést vlastní termíny, v nichž mají být mezery nahrazeny pevnými mezerami tak, aby nedošlo k zalomení uvnitř těchto výrazů. Uveďte vždy každý výraz na samostatný řádek; pokud je výraz složen z více jak dvou slov, tedy je v něm více jak jedna mezera, pak všechny mezery budou nahrazeny za pevné mezery. Lze použít výrazu \\d pro libovolnou číslici (pro pokročilé administrátory: algoritmus používá Perl Compatible Regular Expressions, lze využít syntaxe této specifikace).', 'zalomeni')) . '

' ); } private function add_update_option_hooks() { foreach (array('update_option_zalomeni_prepositions', 'update_option_zalomeni_prepositions_list', 'update_option_zalomeni_conjunctions', 'update_option_zalomeni_conjunctions_list', 'update_option_zalomeni_abbreviations', 'update_option_zalomeni_abbreviations_list', 'update_option_zalomeni_between_number_and_unit', 'update_option_zalomeni_between_number_and_unit_list', 'update_option_zalomeni_space_between_numbers', 'update_option_zalomeni_space_after_ordered_number', 'update_option_zalomeni_spaces_in_scales', 'update_option_zalomeni_custom_terms') as $i) { add_action($i, array($this, 'update_matches_and_replacements')); } } public function update_matches_and_replacements() { update_option('zalomeni_matches', Zalomeni::prepare_matches()); update_option('zalomeni_replacements', Zalomeni::prepare_replacements()); } private function prepare_matches() { $return_array = array(); $word_matches = ''; foreach (array('prepositions', 'conjunctions', 'abbreviations') as $i) { if (get_option('zalomeni_'.$i, constant('Zalomeni::default_'.$i)) == 'on') { $temp_array = explode(',', get_option('zalomeni_'.$i.'_list', constant('Zalomeni::default_'.$i.'_list'))); foreach ($temp_array as $j) { $j = mb_strtolower(trim($j)); $word_matches .= ($word_matches == '' ? '' : '|') . $j; } } } if ($word_matches != '') { $return_array['words'] = '@($|;| | |\(|\n)('.$word_matches.') @i'; } $word_matches = ''; if (get_option('zalomeni_between_number_and_unit', Zalomeni::default_between_number_and_unit) == 'on') { $temp_array = explode(',', get_option('zalomeni_between_number_and_unit_list', Zalomeni::default_between_number_and_unit_list)); foreach ($temp_array as $j) { $j = mb_strtolower(trim($j)); $word_matches .= ($word_matches == '' ? '' : '|') . $j; } } if ($word_matches != '') { $return_array['units'] = '@(\d) ('.$word_matches.')(^|[;\.!:]| | |\?|\n|\)|<|\010|\013|$)@i'; } if (get_option('zalomeni_space_between_numbers', Zalomeni::default_space_between_numbers) == 'on') { $return_array['numbers'] = '@(\d) (\d)@i'; } if (get_option('zalomeni_spaces_in_scales', Zalomeni::default_spaces_in_scales) == 'on') { $return_array['scales'] = '@(\d) : (\d)@i'; } if (get_option('zalomeni_space_after_ordered_number', Zalomeni::default_space_after_ordered_number) == 'on') { $return_array['orders'] = '@(\d\.) ([0-9a-záčďéěíňóřšťúýž])@'; } if (get_option('zalomeni_custom_terms', Zalomeni::default_custom_terms) != '') { $term_counter = 1; $custom_terms = explode(chr(10), str_replace(chr(13), '', get_option('zalomeni_custom_terms', Zalomeni::default_custom_terms))); foreach ($custom_terms as $i) { if (strpos($i, ' ') !== false) { $term = ''; $words_split = explode(' ', $i); foreach ($words_split as $j) { $term .= ($term == '' ? '(' : ' (') . str_replace(array('/', '(', ')'), array('\\/', '\\(', '\\)'), $j) . ')'; } $term = '/' . $term . '/i'; $return_array['customterm' . $term_counter++] = $term; } } } return $return_array; } private function prepare_replacements() { $return_array = array(); foreach (array('prepositions', 'conjunctions', 'abbreviations') as $i) { if (get_option('zalomeni_'.$i, constant('Zalomeni::default_'.$i)) == 'on') { $return_array['words'] = '$1$2 '; break; } } if (get_option('zalomeni_between_number_and_unit', Zalomeni::default_between_number_and_unit) == 'on') { $return_array['units'] = '$1 $2$3'; } if (get_option('zalomeni_space_between_numbers', Zalomeni::default_space_between_numbers) == 'on') { $return_array['numbers'] = '$1 $2'; } if (get_option('zalomeni_spaces_in_scales', Zalomeni::default_spaces_in_scales) == 'on') { $return_array['scales'] = '$1 : $2'; } if (get_option('zalomeni_space_after_ordered_number', Zalomeni::default_space_after_ordered_number) == 'on') { $return_array['orders'] = '$1 $2'; } if (get_option('zalomeni_custom_terms', Zalomeni::default_custom_terms) != '') { $term_counter = 1; $custom_terms = explode(chr(10), str_replace(chr(13), '', get_option('zalomeni_custom_terms', Zalomeni::default_custom_terms))); foreach ($custom_terms as $i) { if (strpos($i, ' ') !== false) { $term = ''; $words_split = explode(' ', $i); $word_counter = 1; foreach ($words_split as $j) { $term .= ($term == '' ? '' : ' ') . '$' . $word_counter++; } $return_array['customterm' . $term_counter++] = $term; } } } return $return_array; } static public function settings_section_description() { echo( '
' . '

Plugin Zalomení
Autor: Honza Skýpala

' . '
' . '

' . Zalomeni::texturize(__('Upravujeme-li písemný dokument, radí nám Pravidla českého pravopisu nepsat neslabičné předložky v, s, z, k na konec řádku, ale psát je na stejný řádek se slovem, které nese přízvuk (např. ve spojení k mostu, s bratrem, v Plzni, z nádraží). Typografické normy jsou ještě přísnější: podle některých je nepatřičné ponechat na konci řádku jakékoli jednopísmenné slovo, tedy také předložky a spojky a, i, o, u;. Někteří pisatelé dokonce nechtějí z estetických důvodů ponechávat na konci řádků jakékoli jednoslabičné výrazy (např. ve, ke, ku, že, na, do, od, pod).', 'zalomeni')) . '

' . '

' . Zalomeni::texturize(__('Více informací na webu Ústavu pro jazyk český, Akademie věd ČR.', 'zalomeni')) . '

' . '

' . Zalomeni::texturize(__('Tento plugin řeší některé z uvedených příkladů: v textu nahrazuje běžné mezery za pevné tak, aby nedošlo k zalomení řádku v nevhodném místě.', 'zalomeni')) . '

' ); } static public function texturize($text) { if (get_option('zalomeni_matches') == '') return $text; // no settings? then fall-back to just return the content $output = ''; $curl = ''; $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); $stop = count($textarr); $no_texturize_tags = apply_filters('no_texturize_tags', array('pre', 'code', 'kbd', 'style', 'script', 'tt')); $no_texturize_shortcodes = apply_filters('no_texturize_shortcodes', array('code')); $no_texturize_tags_stack = array(); $no_texturize_shortcodes_stack = array(); for ($i = 0; $i < $stop; $i++) { $curl = $textarr[$i]; if (!empty($curl)) { global $wp_version; if ('<' != $curl{0} && '[' != $curl{0} && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { // If it's not a tag $curl = preg_replace(get_option('zalomeni_matches'), get_option('zalomeni_replacements'), $curl); $curl = preg_replace(get_option('zalomeni_matches'), get_option('zalomeni_replacements'), $curl); } else if (version_compare($wp_version, '2.9', '<')) { wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); } else { _wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>'); _wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']'); } } $output .= $curl; } return $output; } } $wpZalomeni = new Zalomeni(); ?>PNG  IHDR=1^~QPLTE5_X4Do!PDrEm)RF2Er1Bm/22/6c+Y+V 9/2Er1.>hDp2.An0Bn>i-Dp/2Bl,14`0\$SK G>.(HAm=hDq.Bo./122Dr1BnCp?k+Gt0.[&U$M"MC<Bm,+2iAm@l,Cp=g=h3FsEr+Al)Gv'$Fu:d 6^DA8fL 79b1X"Q63YsxtRNS4oK/ĽypZTSLED強iZ$ÿztleG;/μxfG>>' ojj+>QNchi^~۶.\f[,3)= pep aRj$[bW=|~*f - o^#!LAE+H>BLKCW/)+:HrcI~Z5MUu" $\!hXޙ)ya~NťIkg4T/ۭO./]~J.Bᇖw} 9S7"(:st!L{F4|}(V P4S)6ywnPDB]`\hnEwS.JV=`O2½62{Z []$ymT7U)r]z=*'}v!Se# !uz|o]oBVdT։R~p-*!AH{\#dqvn2Z貒K=2lxʭ0QӓL7V\ɼN~ȿ+tuKaN)6Zƣ" b#jzp(,^.@ʨ:ؒX% 7~p qAїNH]8ܗ *V4k+Gb|W.Fo= ].CyX*҃SZ"VT[2[2S+gbGNw7Φ}45,7WuCӔ0 ~`;rNԥ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6,H&!lA d-H?>Q!b8fЅ$O.]|XSQ,\t$ FW5l=(^c\~(|PV2ojdI]DJ#j { ԓ 78| /5H2RR_m2uA14هOnـY0د{!e(Pr,Қ~}dol7p@}O&å97%K_`P$}\Im u"9+p阰~ᾏOtrnB}-#uBBmFAEA JoEWeZ6sN~+Adȷ\Cm"+J,ɾةP~6&0^L\#5;e]_j!#{r9DG>?U](? ;fe1p .z#!#b ,҄/0HH;BX?z:]KL¼ (}6)ç0)^9O0"1 &W ³bzPz-UmhqVt;\jex'I:]И8R!UNiz[wNKvbTG;Jm%bc,l׿dk?&„ژ{r+TuTmp6Z! ؾ07پO˿btHB+.<~ۼ6J[ ;/4 h)ORT-<+n>T濫]pIԖ×ÇM 6hNI\ 'BEHV. h&*^+w:_!nj_?ƅ2¯?~wny׫ͽ0"1ܶ;[~R2\X7ɹ ߷9D@2͛IauQ]˻kiC(/ck'ҷ:^o#;س6wt)n}2Cr:-1Bu=}_9׉h/l%K}]c6Tɔ'}eNU6?-ҹ*fѾ|Xd|/\}Ut2.q,x_ar"7>Q<-%PfSk_綞Kߪmb2` ]͒pH1o1]/YݒkDi6vcb]dbb_(?R ض>Ā-ƱuKZ*Ci_IGxt+վL.Q7-l5򋷅bkA0 o^C:Sryۤ7?̽m7"8AHחPD,~Y :BǾe:IuYr M<=2rq n֡+f^qQȋgZLYgf=_\#K/) a$K+T f Ptl%Nt2B^4BRww~23"n횚5$1]~}h*F.>  B/.-L\jg\ /n Nb3c˳npZ ^2Ǝm$5E5Jqk["+VX&J(1t7 /5c%GVbei2"fWxDZzܷ ËMcG4dH+նZmݮ7$P{?T`kbT@~|.D2髎I\>}vabNYȓD,@T [&>_"YU<\%SrpYfOEC_ɱ16/vw FFdD3VVty".ҼfVvDx6:c }U ;T _v/orizontal_type = ( isset( $options['floating_horizontal'] ) && 'none' != $options['floating_horizontal'] ) ? $options['floating_horizontal'] : false; // If vertical bar is enabled if ( $vertical_type && // and respsonsiveness is enabled ( ! isset( $options['floating_vertical_responsive'] ) || '-1' != $options['floating_vertical_responsive'] ) ) { // Get min-width for media query $vertical_max_width = ( isset( $options['floating_vertical_responsive_max_width'] ) && is_numeric( $options['floating_vertical_responsive_max_width'] ) ) ? $options['floating_vertical_responsive_max_width'] : '980'; // Set media query $inline_css .= '@media screen and (max-width:' . $vertical_max_width . 'px){' . "\n" . '.a2a_floating_style.a2a_vertical_style{display:none;}' . "\n" . '}'; } // If horizontal bar is enabled if ( $horizontal_type && // and respsonsiveness is enabled ( ! isset( $options['floating_horizontal_responsive'] ) || '-1' != $options['floating_horizontal_responsive'] ) ) { // Get max-width for media query $horizontal_min_width = ( isset( $options['floating_horizontal_responsive_min_width'] ) && is_numeric( $options['floating_horizontal_responsive_min_width'] ) ) ? $options['floating_horizontal_responsive_min_width'] : '981'; // Insert newline if there is inline CSS already $inline_css = 0 < strlen( $inline_css ) ? $inline_css . "\n" : $inline_css; // Set media query $inline_css .= '@media screen and (min-width:' . $horizontal_min_width . 'px){' . "\n" . '.a2a_floating_style.a2a_default_style{display:none;}' . "\n" . '}'; } // If additional CSS (custom CSS for AddToAny) is set if ( ! empty( $options['additional_css'] ) ) { $custom_css = stripslashes( $options['additional_css'] ); // Insert newline if there is inline CSS already $inline_css = 0 < strlen( $inline_css ) ? $inline_css . "\n" : $inline_css; $inline_css .= $custom_css; } // If there is inline CSS if ( 0 < strlen( $inline_css ) ) { // Insert inline CSS wp_add_inline_style( 'addtoany', $inline_css ); } } } add_action( 'wp_enqueue_scripts', 'A2A_SHARE_SAVE_stylesheet', 20 ); function A2A_SHARE_SAVE_enqueue_script() { if ( wp_script_is( 'jquery', 'registered' ) ) { wp_enqueue_script( 'addtoany', plugins_url('/addtoany.min.js', __FILE__ ), array( 'jquery' ), '1.1' ); } } add_action( 'wp_enqueue_scripts', 'A2A_SHARE_SAVE_enqueue_script' ); /** * Cache AddToAny */ function A2A_SHARE_SAVE_refresh_cache() { $contents = wp_remote_fopen( 'https://www.addtoany.com/ext/updater/files_list/' ); $file_urls = explode( "\n", $contents, 20 ); $upload_dir = wp_upload_dir(); // Try to create directory if it doesn't already exist if ( ! wp_mkdir_p( dirname( $upload_dir['basedir'] . '/addtoany/foo' ) ) ) { // Handle directory creation issue // Revert cache option A2A_SHARE_SAVE_revert_cache(); } if ( count( $file_urls ) > 0 ) { for ( $i = 0; $i < count( $file_urls ); $i++ ) { // Download files $file_url = trim( $file_urls[ $i ] ); $file_name = substr( strrchr( $file_url, '/' ), 1, 99 ); // Place files in uploads/addtoany directory $response = wp_remote_get( $file_url, array( 'filename' => $upload_dir['basedir'] . '/addtoany/' . $file_name, 'stream' => true, // Required to use `filename` arg ) ); // Handle error if ( is_wp_error( $response ) ) { // Revert cache option A2A_SHARE_SAVE_revert_cache(); } } } } add_action( 'addtoany_refresh_cache', 'A2A_SHARE_SAVE_refresh_cache' ); function A2A_SHARE_SAVE_schedule_cache() { // Unschedule if already scheduled A2A_SHARE_SAVE_unschedule_cache(); // Try to schedule daily cache refreshes, running once now $result = wp_schedule_event( time(), 'daily', 'addtoany_refresh_cache' ); // Revert cache option if the event didn't get scheduled if ( false === $result ) { A2A_SHARE_SAVE_revert_cache(); } } function A2A_SHARE_SAVE_unschedule_cache() { // Unschedule if scheduled wp_clear_scheduled_hook( 'addtoany_refresh_cache' ); } function A2A_SHARE_SAVE_revert_cache() { // Unschedule A2A_SHARE_SAVE_unschedule_cache(); // Get all existing AddToAny options $options = get_option( 'addtoany_options', array() ); // Revert cache option $options['cache'] = '-1'; update_option( 'addtoany_options', $options ); } /** * Activation hook */ function addtoany_activation() { // Get all existing AddToAny options $options = get_option( 'addtoany_options', array() ); // If the local cache option is enabled if ( isset( $options['cache'] ) && $options['cache'] == '1' ) { // Schedule and run the local cache refresh A2A_SHARE_SAVE_schedule_cache(); } } register_activation_hook( __FILE__, 'addtoany_activation' ); /** * Deactivation hook */ function addtoany_deactivation() { // Unschedule if scheduled A2A_SHARE_SAVE_unschedule_cache(); } register_deactivation_hook( __FILE__, 'addtoany_deactivation' ); /** * Admin Options */ if ( is_admin() ) { include_once $A2A_SHARE_SAVE_plugin_dir . '/addtoany.admin.php'; } function A2A_SHARE_SAVE_add_menu_link() { $page = add_options_page( __( 'AddToAny Share Settings', 'add-to-any' ), __( 'AddToAny', 'add-to-any' ), 'manage_options', 'addtoany', 'A2A_SHARE_SAVE_options_page' ); } add_filter( 'admin_menu', 'A2A_SHARE_SAVE_add_menu_link' ); function A2A_SHARE_SAVE_widgets_init() { global $A2A_SHARE_SAVE_plugin_dir; include_once $A2A_SHARE_SAVE_plugin_dir . '/addtoany.widgets.php'; register_widget( 'A2A_SHARE_SAVE_Widget' ); register_widget( 'A2A_Follow_Widget' ); } add_action( 'widgets_init', 'A2A_SHARE_SAVE_widgets_init' ); // Place in Option List on Settings > Plugins page function A2A_SHARE_SAVE_actlinks( $links, $file ) { // Static so we don't call plugin_basename on every plugin row. static $this_plugin; if ( ! $this_plugin ) { $this_plugin = plugin_basename( __FILE__ ); } if ( $file == $this_plugin ) { $settings_link = '' . __( 'Settings' ) . ''; array_unshift( $links, $settings_link ); // before other links } return $links; } add_filter( 'plugin_action_links', 'A2A_SHARE_SAVE_actlinks', 10, 2 );