Changeset 3265951
- Timestamp:
- 04/03/2025 12:08:30 AM (12 months ago)
- Location:
- wpematico
- Files:
-
- 158 added
- 7 edited
-
tags/2.8.2 (added)
-
tags/2.8.2/app (added)
-
tags/2.8.2/app/addons_page.php (added)
-
tags/2.8.2/app/campaign_edit.php (added)
-
tags/2.8.2/app/campaign_edit_functions.php (added)
-
tags/2.8.2/app/campaign_fetch.php (added)
-
tags/2.8.2/app/campaign_fetch_functions.php (added)
-
tags/2.8.2/app/campaign_help.php (added)
-
tags/2.8.2/app/campaign_log.php (added)
-
tags/2.8.2/app/campaign_preview.php (added)
-
tags/2.8.2/app/campaign_preview_item.php (added)
-
tags/2.8.2/app/campaigns_list.php (added)
-
tags/2.8.2/app/campaigns_list_help.php (added)
-
tags/2.8.2/app/compatibilities.php (added)
-
tags/2.8.2/app/cron.php (added)
-
tags/2.8.2/app/cron_functions.php (added)
-
tags/2.8.2/app/css (added)
-
tags/2.8.2/app/css/campaign_preview.css (added)
-
tags/2.8.2/app/css/campaign_preview_item.css (added)
-
tags/2.8.2/app/css/campaigns_list.css (added)
-
tags/2.8.2/app/css/licenses_handlers.css (added)
-
tags/2.8.2/app/css/wpemat_plugin_styles.css (added)
-
tags/2.8.2/app/css/wpemat_styles.css (added)
-
tags/2.8.2/app/debug_page.php (added)
-
tags/2.8.2/app/js (added)
-
tags/2.8.2/app/js/Date.phpformats.js (added)
-
tags/2.8.2/app/js/bulk_quick_edit.js (added)
-
tags/2.8.2/app/js/campaign_edit.js (added)
-
tags/2.8.2/app/js/campaign_list.js (added)
-
tags/2.8.2/app/js/campaign_preview_feed.js (added)
-
tags/2.8.2/app/js/campaign_preview_item_feed.js (added)
-
tags/2.8.2/app/js/campaign_wizard.js (added)
-
tags/2.8.2/app/js/jquery.tipTip.minified.js (added)
-
tags/2.8.2/app/js/jquery.vSort.js (added)
-
tags/2.8.2/app/js/jquery.vSort.min.js (added)
-
tags/2.8.2/app/js/licenses_handlers.js (added)
-
tags/2.8.2/app/js/oplugins.js (added)
-
tags/2.8.2/app/js/settings_page.js (added)
-
tags/2.8.2/app/js/smart_notifications.js (added)
-
tags/2.8.2/app/js/tools_page.js (added)
-
tags/2.8.2/app/js/wpe_hooks.js (added)
-
tags/2.8.2/app/js/wpematico_updates.js (added)
-
tags/2.8.2/app/lib (added)
-
tags/2.8.2/app/lib/EDD_SL_Plugin_Updater.php (added)
-
tags/2.8.2/app/lib/SimplePie (added)
-
tags/2.8.2/app/lib/SimplePie/Cache (added)
-
tags/2.8.2/app/lib/SimplePie/Content (added)
-
tags/2.8.2/app/lib/SimplePie/Content/Type (added)
-
tags/2.8.2/app/lib/SimplePie/Decode (added)
-
tags/2.8.2/app/lib/SimplePie/Decode/HTML (added)
-
tags/2.8.2/app/lib/SimplePie/HTTP (added)
-
tags/2.8.2/app/lib/SimplePie/Net (added)
-
tags/2.8.2/app/lib/SimplePie/Parse (added)
-
tags/2.8.2/app/lib/SimplePie/XML (added)
-
tags/2.8.2/app/lib/SimplePie/XML/Declaration (added)
-
tags/2.8.2/app/lib/blank-simplepie.php (added)
-
tags/2.8.2/app/lib/browser.php (added)
-
tags/2.8.2/app/lib/licenses_handlers.php (added)
-
tags/2.8.2/app/lib/update_class.php (added)
-
tags/2.8.2/app/lib/welcome.php (added)
-
tags/2.8.2/app/lib/wp_ratings.php (added)
-
tags/2.8.2/app/notification_traslate.php (added)
-
tags/2.8.2/app/plugin_functions.php (added)
-
tags/2.8.2/app/settings_help.php (added)
-
tags/2.8.2/app/settings_page.php (added)
-
tags/2.8.2/app/settings_tabs.php (added)
-
tags/2.8.2/app/smart_notifications.php (added)
-
tags/2.8.2/app/tools_help.php (added)
-
tags/2.8.2/app/tools_page.php (added)
-
tags/2.8.2/app/tools_tabs.php (added)
-
tags/2.8.2/app/wp-backend-helpers.php (added)
-
tags/2.8.2/app/wpe-cron.php (added)
-
tags/2.8.2/app/wpematico_functions.php (added)
-
tags/2.8.2/app/xml-importer.php (added)
-
tags/2.8.2/changelog.md (added)
-
tags/2.8.2/images (added)
-
tags/2.8.2/images/about-header.png (added)
-
tags/2.8.2/images/ai-etruel-rewriter-api-200x100.jpg (added)
-
tags/2.8.2/images/campaign-notification.jpg (added)
-
tags/2.8.2/images/canonical.jpg (added)
-
tags/2.8.2/images/etruelcom_ico.png (added)
-
tags/2.8.2/images/export-import.jpg (added)
-
tags/2.8.2/images/hash.jpg (added)
-
tags/2.8.2/images/icon-256x256.jpg (added)
-
tags/2.8.2/images/image-attributes.jpg (added)
-
tags/2.8.2/images/max-categories.jpg (added)
-
tags/2.8.2/images/mime_type.jpg (added)
-
tags/2.8.2/images/performance.jpg (added)
-
tags/2.8.2/images/popup-deactivate.jpg (added)
-
tags/2.8.2/images/popup_log.jpg (added)
-
tags/2.8.2/images/quick-edit.jpg (added)
-
tags/2.8.2/images/robotico-helmet.png (added)
-
tags/2.8.2/images/robotico_orange-25x25.png (added)
-
tags/2.8.2/images/robotico_orange-50x50.png (added)
-
tags/2.8.2/images/robotico_orange-75x130.png (added)
-
tags/2.8.2/images/shorts.jpg (added)
-
tags/2.8.2/images/tools.jpg (added)
-
tags/2.8.2/images/wpematico-essentials-200x100.jpg (added)
-
tags/2.8.2/images/wpematico-perfect-200x100.jpg (added)
-
tags/2.8.2/images/wpematico-plus-200x100.jpg (added)
-
tags/2.8.2/images/wpematico-rss-feed-reader-200x100.png (added)
-
tags/2.8.2/lang (added)
-
tags/2.8.2/lang/wpematico-ar.mo (added)
-
tags/2.8.2/lang/wpematico-ar.po (added)
-
tags/2.8.2/lang/wpematico-de_DE.mo (added)
-
tags/2.8.2/lang/wpematico-de_DE.po (added)
-
tags/2.8.2/lang/wpematico-el.mo (added)
-
tags/2.8.2/lang/wpematico-el.po (added)
-
tags/2.8.2/lang/wpematico-es_AR.mo (added)
-
tags/2.8.2/lang/wpematico-es_AR.po (added)
-
tags/2.8.2/lang/wpematico-es_CL.mo (added)
-
tags/2.8.2/lang/wpematico-es_CL.po (added)
-
tags/2.8.2/lang/wpematico-es_CO.mo (added)
-
tags/2.8.2/lang/wpematico-es_CO.po (added)
-
tags/2.8.2/lang/wpematico-es_CR.mo (added)
-
tags/2.8.2/lang/wpematico-es_CR.po (added)
-
tags/2.8.2/lang/wpematico-es_EC.mo (added)
-
tags/2.8.2/lang/wpematico-es_EC.po (added)
-
tags/2.8.2/lang/wpematico-es_ES.mo (added)
-
tags/2.8.2/lang/wpematico-es_ES.po (added)
-
tags/2.8.2/lang/wpematico-es_GT.mo (added)
-
tags/2.8.2/lang/wpematico-es_GT.po (added)
-
tags/2.8.2/lang/wpematico-es_MX.mo (added)
-
tags/2.8.2/lang/wpematico-es_MX.po (added)
-
tags/2.8.2/lang/wpematico-es_PE.mo (added)
-
tags/2.8.2/lang/wpematico-es_PE.po (added)
-
tags/2.8.2/lang/wpematico-es_PR.mo (added)
-
tags/2.8.2/lang/wpematico-es_PR.po (added)
-
tags/2.8.2/lang/wpematico-es_UY.mo (added)
-
tags/2.8.2/lang/wpematico-es_UY.po (added)
-
tags/2.8.2/lang/wpematico-es_VE.mo (added)
-
tags/2.8.2/lang/wpematico-es_VE.po (added)
-
tags/2.8.2/lang/wpematico-fa_IR.mo (added)
-
tags/2.8.2/lang/wpematico-fa_IR.po (added)
-
tags/2.8.2/lang/wpematico-fr_FR.mo (added)
-
tags/2.8.2/lang/wpematico-fr_FR.po (added)
-
tags/2.8.2/lang/wpematico-nl_NL.mo (added)
-
tags/2.8.2/lang/wpematico-nl_NL.po (added)
-
tags/2.8.2/lang/wpematico-ro_RO.mo (added)
-
tags/2.8.2/lang/wpematico-ro_RO.po (added)
-
tags/2.8.2/lang/wpematico-ru_RU.mo (added)
-
tags/2.8.2/lang/wpematico-ru_RU.po (added)
-
tags/2.8.2/lang/wpematico-sk_SK.mo (added)
-
tags/2.8.2/lang/wpematico-sk_SK.po (added)
-
tags/2.8.2/lang/wpematico-zh_CN.mo (added)
-
tags/2.8.2/lang/wpematico-zh_CN.po (added)
-
tags/2.8.2/lang/wpematico.pot (added)
-
tags/2.8.2/readme.md (added)
-
tags/2.8.2/readme.txt (added)
-
tags/2.8.2/screenshot-1.jpg (added)
-
tags/2.8.2/screenshot-2.jpg (added)
-
tags/2.8.2/screenshot-3.jpg (added)
-
tags/2.8.2/screenshot-4.jpg (added)
-
tags/2.8.2/screenshot-5.jpg (added)
-
tags/2.8.2/screenshot-6.jpg (added)
-
tags/2.8.2/screenshot-7.jpg (added)
-
tags/2.8.2/wpematico.php (added)
-
tags/2.8.2/wpematico_class.php (added)
-
trunk/app/campaign_fetch.php (modified) (2 diffs)
-
trunk/app/campaign_fetch_functions.php (modified) (7 diffs)
-
trunk/app/plugin_functions.php (modified) (1 diff)
-
trunk/app/wpematico_functions.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wpematico.php (modified) (2 diffs)
-
trunk/wpematico_class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wpematico/trunk/app/campaign_fetch.php
r3261841 r3265951 839 839 $itemUrl = $this->current_item['permalink']; 840 840 $imagen_src = $this->current_item['featured_image']; 841 //**** ecesaria para la featured ? $imagen_src = apply_filters('wpematico_imagen_src', $imagen_src ); // allow strip parts 841 842 842 $imagen_src_real = $this->getRelativeUrl($itemUrl, $imagen_src); 843 // Strip all white space on images URLs. 844 $imagen_src_real = str_replace(' ', '%20', $imagen_src_real); 845 // Fix images URLs with entities like & to get it with correct name and remain the original in images array. 846 $imagen_src_real = html_entity_decode($imagen_src_real); 847 $imagen_src_real = apply_filters('wpematico_img_src_url', $imagen_src_real); 843 844 // Parse the original name on url to get the file correctly 845 $imagen_src_real = $this->parse_src_image($imagen_src_real); 846 848 847 $allowed = (isset($this->cfg['images_allowed_ext']) && !empty($this->cfg['images_allowed_ext']) ) ? $this->cfg['images_allowed_ext'] : 'jpg,gif,png,tif,bmp,jpeg'; 849 848 $allowed = apply_filters('wpematico_allowext', $allowed); 850 //Fetch and Store the Image 851 ///////////////***************************************************************************************//////////////////////// 852 $newimgname = apply_filters('wpematico_newimgname', sanitize_file_name(urlencode(basename($imagen_src_real))), $this->current_item, $this->campaign, $item); // new name here 853 // Primero intento con mi funcion mas rapida 849 850 // Parse the destiny filename to store the file correctly on WP media or system directory 851 $newimgname = $this->parse_dst_image($imagen_src_real, $this->current_item, $this->campaign, $item); 852 853 // Proceed with the Fetch and Store the Image 854 854 $upload_dir = wp_upload_dir(); 855 855 $imagen_dst = trailingslashit($upload_dir['path']) . $newimgname; 856 856 $imagen_dst_url = trailingslashit($upload_dir['url']) . $newimgname; 857 857 $img_new_url = ""; 858 if (in_array(str_replace('.', '', strrchr(strtolower($imagen_dst), '.')), explode(',', $allowed))) { // -------- Controlo extensiones permitidas 858 859 // Check for allowed extensions 860 if (in_array(str_replace('.', '', strrchr(strtolower($imagen_dst), '.')), explode(',', $allowed))) { 859 861 trigger_error('Uploading media=' . $imagen_src . ' <b>to</b> imagen_dst=' . $imagen_dst . '', E_USER_NOTICE); 862 863 // First I try my fastest function 860 864 $newfile = ($options_images['customupload']) ? WPeMatico::save_file_from_url($imagen_src_real, $imagen_dst) : false; 861 if ($newfile) { // subió865 if ($newfile) { // uploaded 862 866 trigger_error('Uploaded media=' . $newfile, E_USER_NOTICE); 863 867 $imagen_dst = $newfile; 864 868 $imagen_dst_url = trailingslashit($upload_dir['url']) . basename($newfile); 865 869 $img_new_url = $imagen_dst_url; 866 } else { // falló -> intento con otros 867 $bits = WPeMatico::wpematico_get_contents($imagen_src_real); 868 $mirror = wp_upload_bits($newimgname, NULL, $bits); 869 if (!$mirror['error']) { 870 trigger_error($mirror['url'], E_USER_NOTICE); 871 $img_new_url = $mirror['url']; 872 } 870 871 } else { // Upload failed 872 // try other methods 873 $bits = WPeMatico::wpematico_get_contents($imagen_src_real); // Read the file 874 875 if (!$bits) { //Reading errors 876 // Actions if give nothing or getting errors 877 trigger_error(__('Failed to obtain file:', 'wpematico') . $imagen_src_real, E_USER_WARNING); 878 }else{ 879 // Obtained -> Try to upload 880 $mirror = wp_upload_bits($newimgname, NULL, $bits); 881 if (!$mirror['error']) { // Upload well 882 trigger_error($mirror['url'], E_USER_NOTICE); 883 $img_new_url = $mirror['url']; 884 } else { // Uploading errors 885 trigger_error(__('Save Featured image file failed:', 'wpematico') . $imagen_dst, E_USER_WARNING); 886 } 887 } 873 888 } 874 889 } 875 } else { 890 } else { // The image[0] was already uploaded with the images in the content, do not upload it again 876 891 $img_new_url = $this->current_item['featured_image']; 877 892 } … … 881 896 $attachid = false; 882 897 if (!$options_images['imgattach']) { 883 //get previously uploaded attach IDs, false if not exist. (Just attach once/first time) 884 // $attachid = $this->get_attach_id_from_url($this->current_item['featured_image']); 898 // Get previously uploaded attach IDs, false if not exist. (Just attach once/first time) 899 900 // $attachid = $this->get_attach_id_from_url($this->current_item['featured_image']); 885 901 $attachid = attachment_url_to_postid($this->current_item['featured_image']); 886 902 } -
wpematico/trunk/app/campaign_fetch_functions.php
r3261841 r3265951 447 447 $itemUrl = $this->current_item['permalink']; 448 448 449 if (sizeof($current_item['images'])) { // Si hay alguna imagen en el contenido449 if (sizeof($current_item['images'])) { // If there is at least one image in the content 450 450 trigger_error('<b>' . __('Looking for images in content.', 'wpematico') . '</b>', E_USER_NOTICE); 451 451 //trigger_error(print_r($current_item['images'],true),E_USER_NOTICE); … … 458 458 $imagen_src = apply_filters('wpematico_imagen_src', $imagen_src); // allow strip parts 459 459 trigger_error(__('Uploading media...', 'wpematico') . $imagen_src, E_USER_NOTICE); 460 460 461 $imagen_src_real = $this->getRelativeUrl($itemUrl, $imagen_src); 461 // Strip all white space on images URLs. 462 $imagen_src_real = str_replace(' ', '%20', $imagen_src_real); 463 // Fix images URLs with entities like & to get it with correct name and remain the original in images array. 464 $imagen_src_real = html_entity_decode($imagen_src_real); 465 $imagen_src_real = apply_filters('wpematico_img_src_url', $imagen_src_real); // original source 462 463 // Parse the original name on url to get the file correctly 464 $imagen_src_real = $this->parse_src_image($imagen_src_real); 465 466 466 $allowed = (isset($this->cfg['images_allowed_ext']) && !empty($this->cfg['images_allowed_ext']) ) ? $this->cfg['images_allowed_ext'] : 'jpg,gif,png,tif,bmp,jpeg'; 467 467 $allowed = apply_filters('wpematico_allowext', $allowed); 468 //Fetch and Store the Image469 ///////////////***************************************************************************************////////////////////////470 $newimgname = apply_filters('wpematico_newimgname', sanitize_file_name(urlencode(basename($imagen_src_real))), $current_item, $campaign, $item); // new name here471 468 472 // We need to cut the number of characters in the name to avoid upload errors by OS limits.473 $newimgname = mb_substr($newimgname , 0, 245);469 // Parse the destiny filename to store the file correctly on WP media or system directory 470 $newimgname = $this->parse_dst_image($imagen_src_real, $current_item, $campaign, $item); 474 471 475 // First I try my fastest function472 // Proceed with the Fetch and Store the Image 476 473 $upload_dir = wp_upload_dir(); 477 474 $imagen_dst = trailingslashit($upload_dir['path']) . $newimgname; 478 475 $imagen_dst_url = trailingslashit($upload_dir['url']) . $newimgname; 479 476 trigger_error('Filtering image extensions:' . $allowed, E_USER_NOTICE); 480 if (in_array(str_replace('.', '', strrchr(strtolower($imagen_dst), '.')), explode(',', $allowed))) { // ----- check allowed extensions 477 478 // Check for allowed extensions 479 if (in_array(str_replace('.', '', strrchr(strtolower($imagen_dst), '.')), explode(',', $allowed))) { 481 480 trigger_error('Uploading media=' . $imagen_src . ' <b>to</b> image=' . $imagen_dst . '', E_USER_NOTICE); 482 // Check if try custom functions to upload files. 481 482 // First I try my fastest function 483 483 $newfile = ($options_images['customupload']) ? WPeMatico::save_file_from_url($imagen_src_real, $imagen_dst) : false; 484 if ($newfile) { // If <> false wasuploaded484 if ($newfile) { // uploaded 485 485 trigger_error('Uploaded media=' . $newfile, E_USER_NOTICE); 486 486 $imagen_dst = $newfile; … … 489 489 do_action('wpematico_new_image_url_uploaded', $imagen_dst_url, $imagen_src, $current_item, $campaign); 490 490 $img_new_url[] = $imagen_dst_url; 491 } else { // Upload fail -> try with others 491 492 } else { // Upload fail 493 // try other methods 492 494 $bits = WPeMatico::wpematico_get_contents($imagen_src_real); // Read the file 493 if (!$bits) { 494 // Remove the image if its upload fail. 495 trigger_error(__('Upload file failed:', 'wpematico') . $imagen_dst, E_USER_WARNING); 495 496 if (!$bits) { //Reading errors 497 // Actions if give nothing or getting errors 498 trigger_error(__('Failed to obtain file:', 'wpematico') . $imagen_src_real, E_USER_WARNING); 499 // Remove the image from content if its upload fail and no link to source. 496 500 if ($options_images['gralnolinkimg']) { 497 // trigger_error( __(' Deleted media img.', 'wpematico' ),E_USER_WARNING);501 // trigger_error( __('Remove img tag from content.', 'wpematico' ),E_USER_NOTICE); 498 502 $current_item['content'] = self::strip_Image_by_src($imagen_src, $current_item['content']); 499 503 } 500 504 } else { 501 //here is the error 502 503 $mirror = wp_upload_bits($newimgname, NULL, $bits); 504 505 506 if (!$mirror['error']) { 505 // Obtained -> Try to upload 506 $mirror = wp_upload_bits($newimgname, NULL, $bits); 507 if (!$mirror['error']) { // Upload well 507 508 trigger_error($mirror['url'], E_USER_NOTICE); 509 510 // Replace the image src from content if its upload well. 508 511 $current_item['content'] = str_replace($imagen_src, $mirror['url'], $current_item['content']); 509 512 do_action('wpematico_new_image_url_uploaded', $mirror['url'], $imagen_src, $current_item, $campaign); 510 $img_new_url[] = $mirror['url']; 511 } else { 512 trigger_error('wp_upload_bits error:' . print_r($mirror, true) . '.', E_USER_WARNING); 513 // Si no quiere linkar las img al server borro el link de la imagen 514 trigger_error(__('Upload file failed:', 'wpematico') . $imagen_dst, E_USER_WARNING); 513 514 $img_new_url[] = $mirror['url']; 515 } else { // Uploading errors 516 //trigger_error('wp_upload_bits error:' . print_r($mirror, true) . '.', E_USER_WARNING); 517 trigger_error(__('Save image file failed:', 'wpematico') . $imagen_dst, E_USER_WARNING); 518 519 // Remove the image from content if its upload fail and no link to source. 515 520 if ($options_images['gralnolinkimg']) { 516 // trigger_error( __(' Deleted media img.', 'wpematico' ),E_USER_WARNING);521 // trigger_error( __('Remove img tag from content.', 'wpematico' ),E_USER_NOTICE); 517 522 $current_item['content'] = self::strip_Image_by_src($imagen_src, $current_item['content']); 518 523 } … … 522 527 } else { 523 528 trigger_error(__('Extension not allowed: ', 'wpematico') . urldecode($imagen_dst_url), E_USER_WARNING); 524 if ($options_images['gralnolinkimg']) { // Si no quiere linkar las img al server borro el link de la imagen 529 // Remove the image from content if it is not allowed and no link to source. 530 if ($options_images['gralnolinkimg']) { 525 531 trigger_error(__('Stripped src.', 'wpematico'), E_USER_WARNING); 526 532 $current_item['content'] = self::strip_Image_by_src($imagen_src, $current_item['content']); … … 538 544 } 539 545 } 540 } // // Si hay alguna imagen en el contenido541 } else { 546 } // END If there is at least one image in the content 547 } else { // If no cache images (not upload to current WordPress 542 548 if (isset($current_item['images']) && sizeof($current_item['images'])) { 543 549 trigger_error('<b>' . __('Using remotely linked images in content. No changes.', 'wpematico') . '</b>', E_USER_NOTICE); … … 550 556 // item images 551 557 552 /** 553 * // retrieves the attachment ID from the file URL 554 * @return integer The attach ID of the image. If not exists return false. 555 */ 556 function get_attach_id_from_url($image_url) { 557 global $wpdb; 558 $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url)); 559 return ($attachment[0] > 0) ? $attachment[0] : FALSE; 560 } 558 // Deprecated custom function in favor of WP native attachment_url_to_postid Apr 2, 2025 559 // /** 560 // * // retrieves the attachment ID from the file URL 561 // * @return integer The attach ID of the image. If not exists return false. 562 // */ 563 // function get_attach_id_from_url($image_url) { 564 // global $wpdb; 565 // $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url)); 566 // return ($attachment[0] > 0) ? $attachment[0] : FALSE; 567 // } 561 568 562 569 /** … … 678 685 } 679 686 687 public function parse_src_image($imagen_src_real) { 688 // Decode URL encoding to properly handle spaces and special characters 689 $imagen_src_real = rawurldecode($imagen_src_real); 690 691 // Replace spaces with %20 to keep URLs valid 692 $imagen_src_real = str_replace(' ', '%20', $imagen_src_real); 693 694 // Apply WordPress sanitization 695 return apply_filters('wpematico_img_src_url', esc_url_raw($imagen_src_real)); 696 } 697 698 public function parse_dst_image($imagen_src_real, $current_item, $campaign, $item) { 699 // Decode URL to handle special characters correctly 700 $basename = rawurldecode(basename($imagen_src_real)); 701 702 // Extract extension and filename 703 $ext = pathinfo($basename, PATHINFO_EXTENSION); 704 $filename = pathinfo($basename, PATHINFO_FILENAME); 705 706 // Allow Chinese characters, letters, numbers, underscores, and dashes 707 $filename = preg_replace('/[^\p{L}\p{N}_-]/u', '', $filename); 708 709 // We need to trim the number of characters in the filename to avoid upload errors by OS limits, while ensuring UTF-8 encoding. 710 // Trim the filename to 200 (because windows?) 711 $filename = mb_substr($filename, 0, apply_filters('wpematico_trim_img_name', 200), 'UTF-8'); 712 713 // Ensure the extension remains intact 714 $newimgname = !empty($ext) ? "{$filename}.{$ext}" : $basename; 715 716 // Apply WordPress sanitization and return the new filename 717 return apply_filters('wpematico_newimgname', sanitize_file_name($newimgname), $current_item, $campaign, $item); 718 } 719 720 680 721 /** 681 722 * Filters images, upload and replace on text item content -
wpematico/trunk/app/plugin_functions.php
r3261841 r3265951 198 198 $subject = 'Plugin Deactivation Feedback'; 199 199 $message = "A user deactivated the plugin for the following reason: " . $reason; 200 $message .= "\n\nThe user wrote the following $explicit_reason"; 200 if($explicit_reason != '') 201 $message .= "\n\nThe user wrote: $explicit_reason"; 202 201 203 $headers = ['From: ' . get_bloginfo('name') . ' <wordpress@' . parse_url(home_url(), PHP_URL_HOST) . '>']; 202 204 -
wpematico/trunk/app/wpematico_functions.php
r3249023 r3265951 21 21 22 22 class WPeMatico_functions { 23 23 24 public static $current_feed = ''; // The current feed that is running. 24 25 -
wpematico/trunk/readme.txt
r3261841 r3265951 243 243 244 244 > See all detailed changelog at [WPeMatico Releases](https://wpematico.com/releases/) 245 246 = 2.8.2 Abr 2, 2025 = 247 248 * Enhanced image upload handling and processing for improved reliability. 249 * Refined feedback email content when the plugin is deactivated. 250 * Replaced custom function with WordPress native `attachment_url_to_postid` for better compatibility and performance. 251 * NOTE: **Enlarges the version required for the [WPeMatico Professional](https://etruel.com/downloads/wpematico-professional/) addon to 3.2** 245 252 246 253 = 2.8.1 Mar 25, 2025 = … … 430 437 == Upgrade Notice == 431 438 432 Fixes few bugs a bout images incorporated in the last version.439 Fixes few bugs and few improvements with images handling. -
wpematico/trunk/wpematico.php
r3261841 r3265951 4 4 * Plugin URI: https://www.wpematico.com 5 5 * Description: Create posts automatically from RSS/Atom feeds organized into campaigns with multiples filters. If you like it, please rate it 5 stars. 6 * Version: 2.8. 16 * Version: 2.8.2 7 7 * Author: Etruel Developments LLC 8 8 * Author URI: https://etruel.com/wpematico/ … … 28 28 private function setup_constants() { 29 29 if (!defined('WPEMATICO_VERSION')) 30 define('WPEMATICO_VERSION', '2.8. 1');30 define('WPEMATICO_VERSION', '2.8.2'); 31 31 if (!defined('WPEMATICO_BASENAME')) 32 32 define('WPEMATICO_BASENAME', plugin_basename(__FILE__)); -
wpematico/trunk/wpematico_class.php
r3249023 r3265951 12 12 13 13 const TEXTDOMAIN = 'wpematico'; 14 const PROREQUIRED = '3. 1';14 const PROREQUIRED = '3.2'; 15 15 const OPTION_KEY = 'WPeMatico_Options'; 16 16
Note: See TracChangeset
for help on using the changeset viewer.