Plugin Directory

Changeset 2696177


Ignore:
Timestamp:
03/18/2022 05:52:36 PM (4 years ago)
Author:
shawon.info
Message:

v2.0.5trunk

Location:
socialmark/trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • socialmark/trunk/changelog.txt

    r2614995 r2696177  
    2626= 2.0.4 =
    2727 * Bug Fixed
     28= 2.0.5 =
     29 * Bug Fixed, whatsapp and telegram support updated, freemium updated
  • socialmark/trunk/freemius/includes/class-freemius.php

    r2519387 r2696177  
    35513551         */
    35523552        static function _toggle_debug_mode() {
     3553            check_admin_referer( 'fs_toggle_debug_mode' );
     3554
    35533555            if ( ! is_super_admin() ) {
    35543556                return;
     
    35723574         */
    35733575        static function _get_debug_log() {
     3576            check_admin_referer( 'fs_get_debug_log' );
     3577
     3578            if ( ! is_super_admin() ) {
     3579                return;
     3580            }
     3581
     3582            $limit  = min( ! empty( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 200, 200 );
     3583            $offset = min( ! empty( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 200, 200 );
     3584
    35743585            $logs = FS_Logger::load_db_logs(
    35753586                fs_request_get( 'filters', false, 'post' ),
    3576                 ! empty( $_POST['limit'] ) && is_numeric( $_POST['limit'] ) ? $_POST['limit'] : 200,
    3577                 ! empty( $_POST['offset'] ) && is_numeric( $_POST['offset'] ) ? $_POST['offset'] : 0
     3587                $limit,
     3588                $offset
    35783589            );
    35793590
     
    44484459         */
    44494460        function _email_about_firewall_issue() {
     4461            check_admin_referer( 'fs_resolve_firewall_issues' );
     4462
     4463            if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
     4464                return;
     4465            }
     4466
    44504467            $this->_admin_notices->remove_sticky( 'failed_connect_api' );
    44514468
     
    45224539         */
    45234540        function _retry_connectivity_test() {
     4541            check_admin_referer( 'fs_retry_connectivity_test' );
     4542
     4543            if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
     4544                return;
     4545            }
     4546
    45244547            $this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
    45254548
  • socialmark/trunk/freemius/includes/managers/class-fs-admin-notice-manager.php

    r2519387 r2696177  
    176176         */
    177177        function dismiss_notice_ajax_callback() {
    178             $this->_sticky_storage->remove( $_POST['message_id'] );
     178            check_admin_referer( 'fs_dismiss_notice_action' );
     179
     180            if ( ! is_numeric( $_POST['message_id'] ) ) {
     181                $this->_sticky_storage->remove( $_POST['message_id'] );
     182            }
     183
    179184            wp_die();
    180185        }
  • socialmark/trunk/freemius/includes/sdk/Exceptions/ArgumentNotExistException.php

    r2519387 r2696177  
    11<?php
     2    if ( ! defined( 'ABSPATH' ) ) {
     3        exit;
     4    }
     5
    26    if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
    37        exit;
  • socialmark/trunk/freemius/includes/sdk/Exceptions/EmptyArgumentException.php

    r2519387 r2696177  
    11<?php
     2    if ( ! defined( 'ABSPATH' ) ) {
     3        exit;
     4    }
     5
    26    if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
    37        exit;
  • socialmark/trunk/freemius/includes/sdk/Exceptions/Exception.php

    r2519387 r2696177  
    11<?php
     2        if ( ! defined( 'ABSPATH' ) ) {
     3            exit;
     4        }
     5
    26    if ( ! class_exists( 'Freemius_Exception' ) ) {
    37        /**
  • socialmark/trunk/freemius/includes/sdk/Exceptions/InvalidArgumentException.php

    r2519387 r2696177  
    11<?php
     2    if ( ! defined( 'ABSPATH' ) ) {
     3        exit;
     4    }
     5
    26    if ( ! class_exists( 'Freemius_Exception' ) ) {
    37        exit;
  • socialmark/trunk/freemius/includes/sdk/Exceptions/OAuthException.php

    r2519387 r2696177  
    11<?php
     2    if ( ! defined( 'ABSPATH' ) ) {
     3        exit;
     4    }
     5
    26    if ( ! class_exists( 'Freemius_Exception' ) ) {
    37        exit;
  • socialmark/trunk/freemius/includes/sdk/FreemiusBase.php

    r2519387 r2696177  
    1616     */
    1717
     18    if ( ! defined( 'ABSPATH' ) ) {
     19        exit;
     20    }
     21
    1822    if ( ! defined( 'FS_API__VERSION' ) ) {
    1923        define( 'FS_API__VERSION', '1' );
  • socialmark/trunk/freemius/includes/sdk/FreemiusWordPress.php

    r2519387 r2696177  
    1515     * under the License.
    1616     */
     17    if ( ! defined( 'ABSPATH' ) ) {
     18        exit;
     19    }
    1720
    1821    require_once dirname( __FILE__ ) . '/FreemiusBase.php';
  • socialmark/trunk/freemius/require.php

    r2519387 r2696177  
    66     * @since       1.1.9
    77     */
     8
     9    if ( ! defined( 'ABSPATH' ) ) {
     10        exit;
     11    }
    812
    913    // Configuration should be loaded first.
  • socialmark/trunk/freemius/start.php

    r2519387 r2696177  
    1616     * @var string
    1717     */
    18     $this_sdk_version = '2.4.2';
     18    $this_sdk_version = '2.4.3';
    1919
    2020    #region SDK Selection Logic --------------------------------------------------------------------
  • socialmark/trunk/freemius/templates/account/partials/addon.php

    r2519387 r2696177  
    11<?php
     2
     3    if ( ! defined( 'ABSPATH' ) ) {
     4        exit;
     5    }
     6
    27    /**
    38     * @var array    $VARS
  • socialmark/trunk/freemius/templates/ajax-loader.php

    r2519387 r2696177  
     1<?php
     2    if ( ! defined( 'ABSPATH' ) ) {
     3        exit;
     4    }
     5?>
    16<div class="fs-ajax-loader" style="display: none"><?php for ( $i = 1; $i <= 8; $i ++ ) : ?><div class="fs-ajax-loader-bar fs-ajax-loader-bar-<?php echo $i ?>"></div><?php endfor ?></div>
  • socialmark/trunk/freemius/templates/debug.php

    r2519387 r2696177  
    3838                    $.post( ajaxurl, {
    3939                        action: 'fs_toggle_debug_mode',
     40                        // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
     41                        _wpnonce   : <?php echo wp_json_encode( wp_create_nonce( 'fs_toggle_debug_mode' ) ); ?>,
    4042                        is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
    4143                    }, function ( response ) {
     
    112114                $.post(ajaxurl, {
    113115                    action     : 'fs_get_db_option',
    114                     _wpnonce   : '<?php echo wp_create_nonce( 'fs_get_db_option' ) ?>',
     116                    // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
     117                    _wpnonce   : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_db_option' ) ); ?>,
    115118                    option_name: optionName
    116119                }, function (response) {
     
    132135                    $.post(ajaxurl, {
    133136                        action      : 'fs_set_db_option',
    134                         _wpnonce   : '<?php echo wp_create_nonce( 'fs_set_db_option' ) ?>',
     137                        // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
     138                        _wpnonce    : <?php echo wp_json_encode( wp_create_nonce( 'fs_set_db_option' ) ); ?>,
    135139                        option_name : optionName,
    136140                        option_value: optionValue
     
    725729                $.post(ajaxurl, {
    726730                    action : 'fs_get_debug_log',
     731                    // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
     732                    _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_debug_log' ) ); ?>,
    727733                    filters: filters,
    728734                    offset : offset,
  • socialmark/trunk/freemius/templates/firewall-issues-js.php

    r2519387 r2696177  
    2323                ajaxActionSuffix = notice.attr( 'data-manager-id' ).replace( ':', '-' );
    2424
    25             var data = {
    26                 action    : 'fs_resolve_firewall_issues_' + ajaxActionSuffix,
    27                 error_type: error_type
    28             };
     25            var data = {
     26                action   : 'fs_resolve_firewall_issues_' + ajaxActionSuffix,
     27                // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
     28                _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_resolve_firewall_issues' ) ); ?>,
     29                error_type: error_type
     30            };
    2931
    3032            if ( 'squid' === error_type ) {
     
    4042
    4143            if ( 'retry_ping' === error_type ) {
    42                 data.action = 'fs_retry_connectivity_test_' + ajaxActionSuffix;
     44                data.action   = 'fs_retry_connectivity_test_' + ajaxActionSuffix;
     45                // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
     46                data._wpnonce = <?php echo wp_json_encode( wp_create_nonce( 'fs_retry_connectivity_test' ) ); ?>;
    4347            }
    4448
  • socialmark/trunk/freemius/templates/partials/network-activation.php

    r2519387 r2696177  
    11<?php
     2
     3    if ( ! defined( 'ABSPATH' ) ) {
     4        exit;
     5    }
     6
    27    /**
    38     * @var array $VARS
  • socialmark/trunk/freemius/templates/sticky-admin-notice-js.php

    r2519387 r2696177  
    2424            notice.fadeOut( 'fast', function() {
    2525                var data = {
    26                     action    : 'fs_dismiss_notice_action_' + ajaxActionSuffix,
     26                    action   : 'fs_dismiss_notice_action_' + ajaxActionSuffix,
     27                    // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
     28                    _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_dismiss_notice_action' ) ); ?>,
    2729                    message_id: id
    2830                };
  • socialmark/trunk/includes/frontend.php

    r2614995 r2696177  
    5656    {
    5757        if (!is_front_page() && !is_home()) {
     58            echo "rankmath";
    5859            function socialmark_change_rankmath_og_img_url($attachment_url)
    5960            {
     
    186187    }
    187188    $socialmark_overlay_position = get_option('default_socialmark_position');
    188     if(isset($socialmark_overlay_image) && !file_exists($socialmark_overlay_image)){
    189         if(wp_get_attachment_url(get_post_thumbnail_id($post_id))){
    190             //return wp_get_attachment_url(get_post_thumbnail_id($post_id));
    191             return 'attachment';
    192         }
    193     }
     189    //will be updated later
     190//    if(isset($socialmark_overlay_image) && !file_exists($socialmark_overlay_image)){
     191//        if(wp_get_attachment_url(get_post_thumbnail_id($post_id))){
     192//            //return wp_get_attachment_url(get_post_thumbnail_id($post_id));
     193//            return 'attachment';
     194//        }
     195//    }
    194196    if (isset($socialmark_overlay_image) && isset($socialmark_main_image) && isset($socialmark_overlay_position)) {
    195197        $socialmark_src_url = $socialmark_overlay_image;
     
    288290        }
    289291        socialmark_imagecopymerge_alpha($socialmark_dest, $socialmark_src, $socialmark_xaxis, $socialmark_yaxis, 0, 0, $socialmark_src_w, $socialmark_src_h, 100);
    290         imagejpeg($socialmark_dest, SOCIALMARK_UPLOAD . '/' . $socialmark_name . '.jpg');
     292//        imagejpeg($socialmark_dest, SOCIALMARK_UPLOAD . '/' . $socialmark_name . '.jpg');
     293//        $socialmark_og_image_url = $socialmark_name . '.jpg';
     294        if (imagesx($socialmark_dest) <= imagesy($socialmark_dest)) {
     295                $socialmark_background = "#FFFFFF";
     296                $socialmark_im = imagecreatetruecolor(1200, 630);
     297
     298// fill the image with the color you want
     299                $color = '0x' . ltrim($socialmark_background, '#');
     300                imagefilledrectangle($socialmark_im, 0, 0, 1200, 630, hexdec($color));
     301                $socialmark_re_width = imagesx($socialmark_dest);
     302                $socialmark_re_height = imagesy($socialmark_dest);
     303                $socialmark_width_re_ratio = $socialmark_width / $socialmark_width;
     304//    $resized_width = 500; //suppose 500 is max width or height
     305//    $resized_height = 500/$ratio;
     306//}
     307//else {
     308                $socialmark_resized_width = 630 * $socialmark_width_re_ratio;
     309                $socialmark_resized_height = 630;
     310                //$image = imagecreatefromjpeg('shirt.jpg');
     311
     312                $sm_resized_image = imagecreatetruecolor($socialmark_resized_width, $socialmark_resized_height);
     313                $left = (1200 - $socialmark_resized_width) / 2;
     314                imagecopyresampled($sm_resized_image, $socialmark_dest, 0, 0, 0, 0, $socialmark_resized_width, $socialmark_resized_height, $socialmark_re_width, $socialmark_re_height);
     315// set the headers and output the image
     316                imagecopymerge($socialmark_im, $sm_resized_image, $left, 0, 0, 0, $socialmark_resized_width, $socialmark_resized_height, 100);
     317                imagejpeg($socialmark_im, SOCIALMARK_UPLOAD . '/' . $socialmark_name . '.jpg');
     318                $socialmark_og_image_url = $socialmark_name . '.jpg';
     319
     320        }else{
     321        $socialmark_crop_array = array('x' =>0 , 'y' =>  $socialmark_extra, 'width' => imagesx($socialmark_dest), 'height'=> imagesy($socialmark_dest)-$socialmark_extra*2);
     322        imagejpeg(imagecrop($socialmark_dest, $socialmark_crop_array), SOCIALMARK_UPLOAD . '/' . $socialmark_name . '.jpg');
    291323        $socialmark_og_image_url = $socialmark_name . '.jpg';
     324    }
     325
    292326        update_post_meta(
    293327            $post_id,
  • socialmark/trunk/readme.txt

    r2614995 r2696177  
    55Tested up to: 5.7.1
    66Requires PHP: 5.3.0 or higher
    7 Stable tag: 2.0.4
     7Stable tag: 2.0.5
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    143143= 2.0.2 =
    144144 * Force url replace enable/disable, twitter card image support for yoast SEO
    145  = 2.0.4 =
     145= 2.0.4 =
    146146  * Bug Fixed
     147= 2.0.5 =
     148 * Bug Fixed, whatsapp and telegram support updated, freemium updated
  • socialmark/trunk/socialmark.php

    r2614995 r2696177  
    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:           2.0.4
     7 * Version:           2.0.5
    88 * Author:            ShawonPro
    99 * Author URI:        https://shawonpro.com/
Note: See TracChangeset for help on using the changeset viewer.