Plugin Directory

Changeset 2550586


Ignore:
Timestamp:
06/18/2021 06:48:20 PM (5 years ago)
Author:
shawon.info
Message:

v1.0.2

Location:
socialmark
Files:
210 added
6 edited

Legend:

Unmodified
Added
Removed
  • socialmark/trunk/changelog.txt

    r2535157 r2550586  
    44= 1.0.1 =
    55 * php fopen include path issue fixed
     6= 1.0.2 =
     7 * dynamic image path generation added. Easy to debug now. WooCommerce support for paid version implemented.
  • socialmark/trunk/includes/admin/admin-options.php

    r2519387 r2550586  
    6565add_action('before_delete_post', 'socialmark_on_post_delete');
    6666function socialmark_on_post_delete($post){
     67    if (get_post_meta($post, 'socialmark_og_image_url', true) && get_post_meta($post, 'socialmark_og_image_url', true) !== "") {
     68
     69        $socialmark_og_image_url = SOCIALMARK_UPLOAD . '/' . esc_attr(get_post_meta($post, 'socialmark_og_image_url', true));
     70        if (file_exists($socialmark_og_image_url)) {
     71            wp_delete_file($socialmark_og_image_url);
     72        }
     73    }
    6774delete_post_meta($post, 'socialmark_og_image_url');
    68 if(file_exists(SOCIALMARK_UPLOAD . '/' . $post . '.jpg')){
    69     wp_delete_file(SOCIALMARK_UPLOAD . '/' . $post . '.jpg');
    70 }
    7175}
    7276
  • socialmark/trunk/includes/admin/admin-settings.php

    r2519387 r2550586  
    4141        )
    4242    );
     43    $socialmark_files = glob(SOCIALMARK_UPLOAD.'/*'); // get all file names
     44    foreach($socialmark_files as $socialmark_file){ // iterate files
     45        if(is_file($socialmark_file)) {
     46           unlink($socialmark_file); // delete file
     47        }
     48    }
    4349
    4450    $socialmark_option_save_message = '<div class="notice notice-success is-dismissible"><p>Settings has been updated.</p></div>';
  • socialmark/trunk/includes/frontend.php

    r2535157 r2550586  
    3232        $post_id = get_the_ID();
    3333        if (get_post_type($post_id) === "post" && get_option('disable_socialmark') !== "on" && get_option('disable_socialmark_posts') !== "on") {
     34            $socialmark_generated_image=socialmark_generate_og_image($post_id);
    3435            echo '
    3536            <!-- Social Image Generated by: SocialMark Plugin -->
     
    3738            <meta name="title" property="og:title" content="'.esc_html( get_the_title() ).'" />
    3839            <meta property="og:url" content="'.get_permalink().'" />
    39             <meta name="image" property="og:image" content="' . socialmark_generate_og_image($post_id) . '">
     40            <meta name="image" property="og:image" content="' . $socialmark_generated_image . '">
    4041            <meta name="twitter:card" content="summary_large_image">
    4142            <meta name="twitter:title" content="'.esc_html( get_the_title() ).'" />
    42             <meta name="twitter:image" content="' . socialmark_generate_og_image($post_id) . '">
     43            <meta name="twitter:image" content="' . $socialmark_generated_image . '">
    4344            <!-- End: SocialMark Plugin -->
    4445            ';
     
    4849        $post_id = get_the_ID();
    4950        if (get_post_type($post_id) === "page" && get_option('disable_socialmark') !== "on" && get_option('disable_socialmark_pages') !== "on") {
     51            $socialmark_generated_image=socialmark_generate_og_image($post_id);
    5052            echo '
    5153            <!-- Social Image Generated by: SocialMark Plugin -->
     
    5355            <meta name="title" property="og:title" content="'.esc_html( get_the_title() ).'" />
    5456            <meta property="og:url" content="'.get_permalink().'" />
    55             <meta name="image" property="og:image" content="' . socialmark_generate_og_image($post_id) . '">
     57            <meta name="image" property="og:image" content="' . $socialmark_generated_image . '">
    5658            <meta name="twitter:card" content="summary_large_image">
    5759            <meta name="twitter:title" content="'.esc_html( get_the_title() ).'" />
    58             <meta name="twitter:image" content="' . socialmark_generate_og_image($post_id) . '">
     60            <meta name="twitter:image" content="' . $socialmark_generated_image . '">
    5961            <!-- End: SocialMark Plugin -->
    6062            ';
     
    6870    if (get_post_meta($post_id, 'socialmark_og_image_url', true) && get_post_meta($post_id, 'socialmark_og_image_url', true) !== "") {
    6971
     72        $socialmark_og_image = SOCIALMARK_UPLOAD . '/' . esc_attr(get_post_meta($post_id, 'socialmark_og_image_url', true));
    7073        $socialmark_og_image_url = SOCIALMARK_UPLOAD_URL . '/' . esc_attr(get_post_meta($post_id, 'socialmark_og_image_url', true));
    71         if (file_exists($socialmark_og_image_url)) {
     74        if (file_exists($socialmark_og_image)) {
    7275            return $socialmark_og_image_url;
    7376        } else {
     
    151154        list($socialmark_src_w, $socialmark_src_h) = getimagesize($socialmark_src_url);
    152155
    153         $socialmark_name = $post_id;
     156        $socialmark_name = time().$post_id;
    154157        if (imagesx($socialmark_dest) < imagesx($socialmark_src)) {
    155158            $socialmark_ratio = imagesy($socialmark_src) / imagesx($socialmark_src);
  • socialmark/trunk/readme.txt

    r2535157 r2550586  
    55Tested up to: 5.7.1
    66Requires PHP: 5.3.0 or higher
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    4040<li><strong>Post-wise Settings:</strong> You can set different overlay for every post/page individually.</li>
    4141<li><strong>Category-wise Settings:</strong> You can set different overlay for specifice category's posts.</li>
     42<li><strong>WooCommerce:</strong> You can set overlay and different featured image for WooCommerce product for social media.</li>
    4243<li><strong>Different Feature Image:</strong> You can upload different feature image only for social media</li>
    4344<li><strong>Enable/Disable:</strong> It is posible to enable or disable SocialMark for any post or page individually as well as enable/disable all posts/pages</li>
     
    8889SocialMark saves automatically generated open graph images into wp-content/uploads folder. Please make sure your "wp-content/uploads" folder is writable.
    8990</li>
     91<li>
     92Press CTRL+U to open view code of your single post webpage then press CTRL+F to open search text box. Type 'og:image' if there is more than 1 search result than please uninstall the other plugin which has generated open graph image url.
     93</li>
     94<li>
     95Still NOT Working? Please email to shawonfreelance at gmail.com We will get back to you within 24 hours and will debug the issue ASAP.
     96</li>
    9097</ul> </dd>
    9198<dt id="how-to-check"><h3><button formaction="#how-to-check">How to check preview?</button></h3></dt>
     
    111118= 1.0.1 =
    112119 * php fopen include path issue fixed
     120= 1.0.2 =
     121 * dynamic image path generation added. Easy to debug now. WooCommerce support for paid version implemented.
  • socialmark/trunk/socialmark.php

    r2535157 r2550586  
    55 * Plugin URI:        https://shawonpro.com/socialmark-wp-plugin/
    66 * Description:       Easy way to add/change overlay/watermark to Facebook, Twitter, open graph post preview images.
    7  * Version:           1.0.1
     7 * Version:           1.0.2
    88 * Author:            ShawonPro
    99 * Author URI:        https://shawonpro.com/
Note: See TracChangeset for help on using the changeset viewer.