Plugin Directory

Changeset 3417088


Ignore:
Timestamp:
12/11/2025 08:02:20 AM (4 weeks ago)
Author:
Litonice13
Message:

Update to version 3.0.0 from GitHub

Location:
custom-breakpoints-for-elementor
Files:
455 added
16 deleted
17 edited
1 copied

Legend:

Unmodified
Added
Removed
  • custom-breakpoints-for-elementor/assets/banner-1544x500.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-breakpoints-for-elementor/assets/banner-772x250.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-breakpoints-for-elementor/assets/icon-256x256.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-breakpoints-for-elementor/tags/3.0.0/assets/css/master-cbp-admin.css

    r2561184 r3417088  
    1 /* Master Custom Breakpoint */
    2 .jltma-wrap {
    3     width: 79%;
    4     align-items: center;
    5     margin-left: auto;
    6     margin-right: auto;
    7 }
    8 
    9 .master_cbp_table ul:nth-child(odd) {
    10     background: #f9f9f9;
    11     border-bottom: 1px solid #ececec;
    12 }
    13 
    14 .master_cbp_table ul:nth-child(even) {
    15   background: #fff;
    16 }
    17 
    18 .master_cbp_table ul.breakpoint-is-recent {
    19     background: #6a14d1;
    20 }
    21 
    22 #jltma-mcb-message {
    23     background: #fff;
    24     text-align: center;
    25     padding: 30px;
    26     color: #000;
    27     font-size: 25px;
    28     margin: 50px 0;
    29     border: 1px dashed #222;   
    30 }
    31 #jltma-mcb-message a {
    32     color:#fd1919;
    33     font-weight:bold;
    34     text-decoration:none;
    35 }
    36 
    37 .jltma-mcb-pro-badge {
    38     position: absolute;
    39     z-index: 333;
    40     text-align: center;
    41     padding-left: 36%;
    42     font-size: 100px !important;
    43     padding-top: 3%;
    44 }
    45 
    46 .jltma-mcb-disabled{
    47     pointer-events: none;
    48     opacity: 0.4;
    49 }
    50 @media screen and (min-width: 600px) {
    51     .jlmta-cbp-input-form {
    52         display: table;
    53     }
    54     .jltma-wrap h2{
    55         font-size: 30px;
    56         padding: 0px 0 0px;
    57     }
    58     .master_cbp_table ul {
    59         display: table-row;
    60     }
    61 
    62     .master_cbp_table ul:first-child li {
    63         background-color: #f7f7fa;
    64         color: #90a4ae;
    65         padding: 20px;
    66         font-size: 1.2em;
    67         font-family: sans-serif,'Poppins';
    68         line-height: 20px;
    69         border-bottom: none;   
    70     }
    71 
    72     .master_cbp_table ul > li {
    73         display: table-cell;
    74         padding: 20px;
    75     }
    76 
    77     .jltma-wrap .jltma-cbp-ex-imp-head{
    78         padding-top: 100px;
    79     }
    80    
    81     .master_cbp_table input[type=text],
    82     .master_cbp_table input[type=number],
    83     .master_cbp_table select{
    84         min-height: 35px;
    85         padding-left: 20px;
    86         border-radius: 22.5px;
    87         border: 1px solid #ededf2;
    88     }
    89 
    90     .master_cbp_table input[type=text]:focus,
    91     .master_cbp_table input[type=number]:focus,
    92     .master_cbp_table select:focus{
    93         box-shadow: 0 0px 15px 0 rgba(0, 0, 0, 0.1) !important;
    94     }
    95 
    96     .master_cbp_table .button.button-primary{
    97         border-radius: 50px;
    98         font-size: 22px;
    99         line-height: 25px;
    100         padding: 2px 11px 5px;
    101     }
    102     .jltma-wrap .button.button-primary{
    103         border-radius: 50px;
    104         font-size: 16px;
    105         padding: 0px 10px 0px;     
    106     }
    107     .jltma-mcb-settings .button.button-primary{
    108         font-size: 15px;
    109         padding: 5px 20px 5px;         
    110     }
    111     .jltma-mcb-settings .button.button-primary:focus,
    112     .jltma-mcb-settings .button.button-primary:active{
    113         background: #fd1919;
    114         border-color: #fd1919;
    115         outline: none;
    116     }
    117 
    118     .jltma-wrap .button.button-primary:focus{
    119         box-shadow: none;
    120     }
    121     .master_cbp_table .jltma-cbp-remove{
    122         background: #f67373;
    123         border-color: #f67373; 
    124         margin-top: -5px;
    125         outline: none;
    126     }
    127     .master_cbp_table .jltma-cbp-remove:hover{
    128         background: #fd1919 !important;
    129         border-color: #fd1919 !important;
    130         outline: none;
    131     }
    132     .jlmta-cbp-input-form .submit{
    133         float: right;
    134     }
    135     .jlmta-cbp-input-form .submit .button{
    136         border-radius: 22.5px;
    137         padding: 5px 20px;
    138         font-size: 14px;
    139         line-height: 30px;
    140     }
    141     .jlmta-cbp-input-form .jltma-cbp-add, .jltma-wrap .jltma-cbp-add, .jltma-mcb-settings .jltma-cbp-reset{
    142         background: #6a14d1;
    143         border-color: #6a14d1;
    144     }
    145     .jlmta-cbp-input-form .jltma-cbp-save, .jltma-wrap .jltma-cbp-save{
    146         background: #e8156e;
    147         border-color: #e8156e;
    148     }
    149     .jlmta-cbp-input-form .button.button-primary:hover, .jltma-wrap .jltma-cbp-add:hover, .jltma-mcb-settings .jltma-cbp-reset:hover{
    150         background: #41008e;
    151         border-color: #41008e;
    152         color: #fff;
    153     }
    154     .jlmta-cbp-input-form .submit .button.jltma-cbp-save:hover,
    155     .jlmta-cbp-input-form .submit .button.jltma-cbp-save:focus,
    156     .jlmta-cbp-input-form .submit .button.jltma-cbp-save:active,
    157     .jltma-wrap .jltma-cbp-save:hover{
    158         background: #fd1919;
    159         border-color: #fd1919;
    160         color: #fff;
    161     }
    162 
    163     .loading .master_cbp_table::before {
    164       opacity: .5;
    165       position: absolute;
    166       content: "";
    167       top: 0;
    168       left: 0;
    169       height: 100%;
    170       width: 100%;
    171       background-color: #fff;
    172 
    173       -webkit-transition: opaicty .5s ease;
    174       -o-transition: opaicty .5s ease;
    175       transition: opaicty .5s ease;
    176 
    177       z-index: 5;
    178       border-radius: inherit;
    179     }
    180     .jlmta-cbp-input-form .updated{
    181         opacity: 1;
    182     }
    183     .loading .jltma-spinner { display: block; }
    184 
    185 
    186 }
    187 
    188 /* small */
    189 @media screen and (max-width: 599px) {
    190   .master_cbp_table ul {
    191     border: solid 1px #ccc;
    192     display: block;
    193     list-style: none;
    194     margin: 1em;
    195     padding: 0.5em 1em;
    196   }
    197 
    198   .master_cbp_table ul:first-child {
    199     display: none;
    200   }
    201 
    202   .master_cbp_table ul > li {
    203     display: block;
    204     padding: 0.25em 0;
    205   }
    206   .master_cbp_table ul:nth-child(odd) > li + li {
    207     border-top: solid 1px #ccc;
    208   }
    209 
    210   .master_cbp_table ul:nth-child(even) > li + li {
    211     border-top: solid 1px #eee;
    212   }
    213 
    214   .master_cbp_table ul > li:before {
    215     color: #000;
    216     content: attr(data-label);
    217     display: inline-block;
    218     font-size: 75%;
    219     font-weight: bold;
    220     text-transform: capitalize;
    221     vertical-align: top;
    222     width: 50%;
    223   }
    224 
    225   .master_cbp_table p {
    226     margin: -1em 0 0 50%;
    227   }
    228 }
    229 
    230 /* tiny */
    231 @media screen and (max-width: 349px) {
    232   .master_cbp_table ul > li:before {
    233     display: block;
    234   }
    235 
    236   .master_cbp_table p {
    237     margin: 0;
    238   }
    239 }
    240 
     1@charset "UTF-8";.jltma-toaster-container{position:fixed;bottom:30px;left:50%;transform:translate(-50%);z-index:1000000;pointer-events:none;display:flex;flex-direction:column;align-items:center;gap:10px}.jltma-toaster{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;padding:16px 24px;border-radius:8px;box-shadow:0 10px 40px #667eea66;font-size:14px;font-weight:500;min-width:300px;max-width:500px;text-align:center;pointer-events:auto;animation:jltma-toaster-slide-up .3s ease-out;position:relative;overflow:hidden;display:flex;align-items:center;gap:10px}.jltma-toaster:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(135deg,rgba(255,255,255,.2) 0%,transparent 100%);pointer-events:none}.jltma-toaster.success{background:linear-gradient(135deg,#00b09b,#96c93d);box-shadow:0 10px 40px #00b09b66}.jltma-toaster.error{background:linear-gradient(135deg,#f85032,#e73827);box-shadow:0 10px 40px #f8503266}.jltma-toaster.warning{background:linear-gradient(135deg,#f7971e,#ffd200);box-shadow:0 10px 40px #f7971e66}.jltma-toaster.info{background:linear-gradient(135deg,#4facfe,#00f2fe);box-shadow:0 10px 40px #4facfe66}.jltma-toaster.jltma-toaster-exit{animation:jltma-toaster-slide-down .3s ease-out;opacity:0}.jltma-toaster .jltma-toaster-icon{flex-shrink:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-weight:700;position:relative;z-index:1}.jltma-toaster .jltma-toaster-icon svg{width:100%;height:100%;fill:currentColor}.jltma-toaster .jltma-toaster-icon.success-icon:before{content:"✓";font-size:18px;font-weight:700}.jltma-toaster .jltma-toaster-icon.error-icon:before{content:"✕";font-size:20px;font-weight:700}.jltma-toaster .jltma-toaster-icon.warning-icon:before{content:"!";font-size:20px;font-weight:700}.jltma-toaster .jltma-toaster-icon.info-icon:before{content:"i";font-size:18px;font-weight:700;font-style:italic}.jltma-toaster .jltma-toaster-content{flex:1;position:relative;z-index:1}.jltma-toaster .jltma-toaster-close{background:#fff3;border:none;color:currentColor;width:24px;height:24px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .3s ease;flex-shrink:0;position:relative;z-index:1}.jltma-toaster .jltma-toaster-close:hover{background:#ffffff4d}.jltma-toaster .jltma-toaster-close:before{content:"✕";font-size:12px;line-height:1}.jltma-toaster .jltma-toaster-progress{position:absolute;bottom:0;left:0;height:3px;background:#ffffff80;animation:jltma-toaster-progress 3s linear;animation-fill-mode:forwards}@keyframes jltma-toaster-slide-up{0%{transform:translateY(100px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes jltma-toaster-slide-down{0%{transform:translateY(0);opacity:1}to{transform:translateY(100px);opacity:0}}@keyframes jltma-toaster-progress{0%{width:100%}to{width:0}}.jltma_cbp_button{display:flex;align-items:center;justify-content:center;gap:4px;border-radius:22.5px;padding:5px 20px;line-height:30px;border:none;font-size:14px;font-weight:500;cursor:pointer;color:#fff;background:#6a14d1;transition:all .15s}.jltma_cbp_button:hover{background:#41008e}.jltma_cbp_button_secondary{background:#e8156e}.jltma_cbp_button_secondary:hover{background:#fd1919}.jltma_cbp_button_outline{color:#000;background:transparent;border:1px solid #6a14d1}.jltma_cbp_button_outline:hover{color:#fff;background:#6a14d1}.jltma-disabled{pointer-events:none;opacity:.5}#custom_breakpoints_page{margin-top:48px}#custom_breakpoints_page>h2{margin:0;font-size:32px}#custom_breakpoints_page>p{margin:14px 0 0}.jltma_cbp_wrapper{margin-top:32px;display:grid;grid-template-columns:1fr 300px;gap:32px}.jltma_cbp_wrapper .jltma_cbp_breakpoints{background:#fff;padding:24px;border-radius:8px;box-shadow:#959da533 0 8px 24px}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr 1fr 1fr 100px;font-size:16px;font-weight:500}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li{padding:12px;margin-bottom:0}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li:last-child{text-align:center}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li input:focus{outline:none;border:none;box-shadow:none}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li .jltma-cbp-remove{background:#f8d9d9;border-color:#fdb7b7;margin-top:-5px;outline:none;width:32px;height:32px;border-radius:100px;display:flex;align-items:center;justify-content:center;color:#000;transition:all .2s}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li .jltma-cbp-remove:hover{color:#fff;background:#fd1919!important;border-color:#fd1919!important;outline:none}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul:nth-child(odd){background:#f9f9f9;border-bottom:1px solid #ececec}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul:nth-child(2n){background:#fff}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul.jltma_cbp-is-recent{background:#6a14d1}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_submit-wrapper{display:flex;align-items:center;justify-content:space-between}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_submit-wrapper .jltma_cbp_right_buttons{display:flex;align-items:center;gap:12px}.jltma_cbp_wrapper .jltma_cbp_breakpoints #jltma-mcb-message{background:#fff;text-align:center;padding:30px;color:#000;font-size:25px;margin:50px 0;border:1px dashed #222}.jltma_cbp_wrapper .jltma_cbp_breakpoints #jltma-mcb-message a{color:#fd1919;font-weight:700;text-decoration:none}.jltma_cbp_settings{background:#fff;padding:24px;border-radius:8px;box-shadow:#959da533 0 8px 24px;position:relative}.jltma_cbp_settings .jltma_cbp_pro_settings{position:absolute;top:0;left:0;border-radius:8px;width:100%;height:100%;background:#0000003f;backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px);display:flex;align-items:center;justify-content:center}.jltma_cbp_settings .jltma_cbp_pro_settings span{display:inline-flex;align-items:center;justify-content:center;width:fit-content;gap:4px;padding:6px 10px;font-size:18px;font-weight:500;color:#fff;white-space:nowrap;background-color:#f97316;border:1px solid transparent;border-radius:6px;overflow:hidden;transition:color .15s,box-shadow .15s;-webkit-user-select:none;user-select:none;flex-shrink:0}.jltma_cbp_settings .jltma_cbp_pro_settings .jltma_cbp_settings_import{margin-top:16px}.jltma_cbp_settings .jltma_cbp_pro_settings .jltma_cbp_settings_import+.jltma_cbp_settings_export h3{margin:0}.jltma_cbp_settings .jltma_cbp_pro_settings .jltma_cbp_settings_import+.jltma_cbp_settings_export p{margin:12px 0 0}.jltma-wrap{width:79%;align-items:center;margin-left:auto;margin-right:auto}
  • custom-breakpoints-for-elementor/tags/3.0.0/class-master-custom-breakpoint.php

    r2704815 r3417088  
    11<?php
     2
    23namespace MasterCustomBreakPoint;
    34
    45defined( 'ABSPATH' ) || exit;
     6if ( !class_exists( 'JLTMA_Master_Custom_Breakpoint' ) ) {
     7    class JLTMA_Master_Custom_Breakpoint {
     8        public $dir;
    59
    6 if( !class_exists('JLTMA_Master_Custom_Breakpoint') ){
     10        public $url;
    711
    8     class JLTMA_Master_Custom_Breakpoint{
     12        private static $plugin_path;
    913
    10         public $dir;
     14        private static $plugin_url;
    1115
    12         public $url;
     16        private static $_instance = null;
    1317
    14         private static $plugin_path;
     18        const MINIMUM_PHP_VERSION = '5.6';
    1519
    16         private static $plugin_url;
     20        const MINIMUM_ELEMENTOR_VERSION = '2.0.0';
    1721
    18         private static $_instance = null;
     22        public static $plugin_name = 'Elementor Breakpoints Extender';
    1923
    20         const MINIMUM_PHP_VERSION = '5.6';
     24        public function __construct() {
     25            $this->jltma_mcb_include_files();
     26            add_action( 'init', [$this, 'jltma_mcb_i18n'] );
     27            add_action( 'plugins_loaded', [$this, 'init'] );
     28        }
    2129
    22         const MINIMUM_ELEMENTOR_VERSION = '2.0.0';
     30        public function jltma_mcb_i18n() {
     31            load_plugin_textdomain( 'custom-breakpoints-for-elementor' );
     32        }
    2333
    24         public static $plugin_name = 'Elementor Breakpoints Extender';
     34        public function init() {
     35            // If 'is_plugin_active' function not found
     36            if ( !function_exists( 'is_plugin_active' ) ) {
     37                require_once ABSPATH . '/wp-admin/includes/plugin.php';
     38            }
     39            if ( is_plugin_active( 'elementor/elementor.php' ) ) {
     40                // Minimum supported Elementor version is 3.5.1+
     41                if ( version_compare( ELEMENTOR_VERSION, '3.5.1', '>=' ) ) {
     42                    include_once JLTMA_MCB_PLUGIN_PATH . 'lib/core/breakpoints/manager.php';
     43                    include_once JLTMA_MCB_PLUGIN_PATH . 'lib/misc.php';
     44                }
     45            }
     46            self::jltma_mcb_plugin_activation_hook();
     47        }
    2548
    26         public function __construct(){
     49        public function jltma_mcb_include_files() {
     50            if ( !class_exists( 'TGM_Plugin_Activation' ) ) {
     51                include JLTMA_MCB_PLUGIN_PATH . 'inc/class-tgm-plugin-activation.php';
     52            }
     53            include JLTMA_MCB_PLUGIN_PATH . 'inc/breakpoint-assets.php';
     54            include JLTMA_MCB_PLUGIN_PATH . 'inc/hooks.php';
     55        }
    2756
    28             $this->jltma_mcb_include_files();
     57        // Activation Hook
     58        public static function jltma_mcb_plugin_activation_hook() {
     59            if ( get_option( 'jltma_mcb_activation_time' ) === false ) {
     60                update_option( 'jltma_mcb_activation_time', strtotime( "now" ) );
     61            }
     62        }
    2963
    30             add_action( 'init', [ $this, 'jltma_mcb_i18n' ] );
     64        public function is_elementor_activated( $plugin_path = 'elementor/elementor.php' ) {
     65            $installed_plugins_list = get_plugins();
     66            return isset( $installed_plugins_list[$plugin_path] );
     67        }
    3168
    32             add_action( 'plugins_loaded', [ $this, 'init' ] );
     69        public static function get_instance() {
     70            if ( is_null( self::$_instance ) ) {
     71                self::$_instance = new self();
     72            }
     73            return self::$_instance;
     74        }
    3375
    34         }
     76    }
    3577
    36         public function jltma_mcb_i18n(){
    37             load_plugin_textdomain( 'master-custom-breakpoint' );
    38         }
    39 
    40         public function init(){
    41             // If 'is_plugin_active' function not found
    42             if ( ! function_exists( 'is_plugin_active' ) ){
    43                 require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    44             }
    45 
    46             if ( is_plugin_active( 'elementor/elementor.php' ) ) {
    47 
    48                 // Check if the Version between 2.9.0 to 3.0.0
    49                 if ( version_compare( ELEMENTOR_VERSION, '2.9.0', '>=' ) && version_compare( ELEMENTOR_VERSION, '3.0.0', '<' ) ) {
    50 
    51                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/base.php';
    52                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/frontend.php';
    53                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/responsive.php';
    54                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/controls-stack.php';
    55                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/stylesheet.php';
    56                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/editor.php';
    57 
    58                 } elseif ( version_compare( ELEMENTOR_VERSION, '3.0.0', '>' ) && version_compare( ELEMENTOR_VERSION, '3.2.4', '<' ) ) {
    59 
    60                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/base.php';
    61                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/responsive.php';
    62                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/controls-stack.php';
    63                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/editor.php';
    64 
    65                 } elseif ( version_compare( ELEMENTOR_VERSION, '3.2.4', '>=' ) && version_compare( ELEMENTOR_VERSION, '3.5.0', '<' ) ) {
    66 
    67                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/core/breakpoints/manager.php';
    68                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/core/breakpoints/breakpoint.php';
    69                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/core/editor/editor.php';
    70                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/includes/base/controls-stack.php';
    71                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/misc.php';
    72 
    73                 } elseif ( version_compare( ELEMENTOR_VERSION, '3.5.1', '>=' ) ) {
    74                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib/core/breakpoints/manager.php';
    75                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib/misc.php';
    76                 }
    77                
    78             }
    79 
    80             self::jltma_mcb_plugin_activation_hook();
    81         }
    82 
    83 
    84         public function jltma_mcb_include_files(){
    85             if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
    86                 include JLTMA_MCB_PLUGIN_PATH . 'inc/class-tgm-plugin-activation.php';
    87             }
    88             include JLTMA_MCB_PLUGIN_PATH . 'inc/breakpoint-assets.php';
    89             include JLTMA_MCB_PLUGIN_PATH . 'inc/hooks.php';
    90         }
    91 
    92 
    93         // Activation Hook
    94         public static function jltma_mcb_plugin_activation_hook(){
    95 
    96             if (get_option('jltma_mcb_activation_time') === false)
    97                 update_option('jltma_mcb_activation_time', strtotime("now") );
    98 
    99 
    100             $custom_breakpoints = json_decode(file_get_contents( JLTMA_MCB_PLUGIN_PATH . '/custom_breakpoints.json'), true);
    101             if (get_option('jltma_mcb_activation_time') === false)
    102                 update_option('jltma_mcb', $custom_breakpoints );           
    103         }
    104 
    105         public function is_elementor_activated( $plugin_path = 'elementor/elementor.php' ) {
    106             $installed_plugins_list = get_plugins();
    107 
    108             return isset( $installed_plugins_list[ $plugin_path ] );
    109         }
    110 
    111 
    112         public static function get_instance() {
    113             if ( is_null( self::$_instance ) ) {
    114                 self::$_instance = new self();
    115             }
    116             return self::$_instance;
    117         }
    118     }
    11978}
    120 
    12179JLTMA_Master_Custom_Breakpoint::get_instance();
  • custom-breakpoints-for-elementor/tags/3.0.0/custom-breakpoints-for-elementor.php

    r2704819 r3417088  
    11<?php
     2
    23/**
    34 * Plugin Name: Custom Breakpoints for Elementor
    4  * Description: Elementor Custom Breakpoint Created by <a href="https://master-addons.com/demos/custom-breakpoints/" target="_blank">Master Addons</a>
    5  * Plugin URI:  https://master-addons.com
    6  * Version:     2.0.2
     5 * Description: Elementor Custom Breakpoint Created by <a href="https://master-addons.com/custom-breakpoints/" target="_blank">Master Addons</a>
     6 * Plugin URI:  https://master-addons.com/
     7 * Version:     3.0.0
    78 * Author:      Jewel Theme
    8  * Author URI:  https://master-addons.com/demos/custom-breakpoints/
     9 * Author URI:  https://master-addons.com/custom-breakpoints/
    910 * License:     GPL-2.0+
    1011 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    11  * Text Domain: master-custom-breakpoint
     12 * Text Domain: custom-breakpoints-for-elementor
    1213 * Domain Path: /languages
    13  * Elementor tested up to: 3.5.3
    14  * Elementor Pro tested up to: 3.5.0
     14 * Elementor tested up to: 3.33.4
     15 * Elementor Pro tested up to: 3.33.1
     16 *
    1517 */
     18defined( 'ABSPATH' ) || exit;
     19$jltma_custom_breakpoints_plugin_data = get_file_data( __FILE__, array(
     20    'Version'     => 'Version',
     21    'Plugin Name' => 'Plugin Name',
     22    'Author'      => 'Author',
     23    'Description' => 'Description',
     24    'Plugin URI'  => 'Plugin URI',
     25), false );
     26if ( !defined( 'JLTMA_MCB' ) ) {
     27    define( 'JLTMA_MCB', $jltma_custom_breakpoints_plugin_data['Plugin Name'] );
     28}
     29if ( !defined( 'JLTMA_MCB_PLUGIN_DESC' ) ) {
     30    define( 'JLTMA_MCB_PLUGIN_DESC', $jltma_custom_breakpoints_plugin_data['Description'] );
     31}
     32if ( !defined( 'JLTMA_MCB_VERSION' ) ) {
     33    define( 'JLTMA_MCB_VERSION', $jltma_custom_breakpoints_plugin_data['Version'] );
     34}
     35if ( !defined( 'JLTMA_MCB_TD' ) ) {
     36    define( 'JLTMA_MCB_TD', 'custom-breakpoints-for-elementor' );
     37}
     38if ( !defined( 'JLTMA_MCB_PLUGIN_PATH' ) ) {
     39    define( 'JLTMA_MCB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
     40}
     41if ( !defined( 'JLTMA_MCB_PLUGIN_URL' ) ) {
     42    define( 'JLTMA_MCB_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
     43}
     44if ( !defined( 'JLTMA_MCB_PLUGIN_DIR' ) ) {
     45    define( 'JLTMA_MCB_PLUGIN_DIR', plugin_basename( __FILE__ ) );
     46}
     47if ( !function_exists( 'jltma_cbfe' ) ) {
     48    // Create a helper function for easy SDK access.
     49    function jltma_cbfe() {
     50        global $jltma_cbfe;
     51        if ( !isset( $jltma_cbfe ) ) {
     52            // Activate multisite network integration.
     53            if ( !defined( 'WP_FS__PRODUCT_22184_MULTISITE' ) ) {
     54                define( 'WP_FS__PRODUCT_22184_MULTISITE', true );
     55            }
     56            // Include Freemius SDK.
     57            // SDK is auto-loaded through Composer
     58            // Include Freemius SDK.
     59            require_once __DIR__ . '/lib/freemius/start.php';
     60            $jltma_cbfe = fs_dynamic_init( array(
     61                'id'                  => '22184',
     62                'slug'                => 'custom-breakpoints-for-elementor',
     63                'type'                => 'plugin',
     64                'public_key'          => 'pk_6e6f38dff3de46f1129c72463e152',
     65                'is_premium'          => false,
     66                'has_addons'          => false,
     67                'has_paid_plans'      => true,
     68                'menu'                => array(
     69                    'slug'       => 'custom-breakpoints-for-elementor',
     70                    'first-path' => 'admin.php?page=custom-breakpoints-for-elementor',
     71                    'account'    => true,
     72                    'contact'    => false,
     73                    'pricing'    => true,
     74                    'support'    => false,
     75                ),
     76                'parallel_activation' => array(
     77                    'enabled'                  => true,
     78                    'premium_version_basename' => 'custom-breakpoints-for-elementor-premium/custom-breakpoints-for-elementor.php',
     79                ),
     80                'is_live'             => true,
     81            ) );
     82        }
     83        return $jltma_cbfe;
     84    }
    1685
    17 
    18 defined( 'ABSPATH' ) || exit;
    19 
    20 define( 'JLTMA_MCB_VERSION', '1.0.6' );
    21 define( 'JLTMA_MCB_TD', 'master-custom-breakpoint' );
    22 define( 'JLTMA_MCB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    23 define( 'JLTMA_MCB_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
    24 define( 'JLTMA_MCB_PLUGIN_DIR', plugin_basename( __FILE__ ) );
    25 
    26 
    27 require plugin_dir_path( __FILE__ ) . 'class-master-custom-breakpoint.php';
    28 
    29 
     86    // Init Freemius.
     87    jltma_cbfe();
     88    // Disable automatic plugin deactivation on activation
     89    jltma_cbfe()->add_filter( 'deactivate_on_activation', '__return_false' );
     90    // Signal that SDK was initiated.
     91    do_action( 'jltma_cbfe_loaded' );
     92}
    3093// Activation and Deactivation hooks
    31 if ( class_exists('\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint') ) {
    32     register_activation_hook( __FILE__ , array('\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint', 'jltma_mcb_plugin_activation_hook'));
     94if ( !class_exists( '\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint' ) ) {
     95    require JLTMA_MCB_PLUGIN_PATH . 'class-master-custom-breakpoint.php';
     96    register_activation_hook( __FILE__, array('\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint', 'jltma_mcb_plugin_activation_hook') );
    3397}
  • custom-breakpoints-for-elementor/tags/3.0.0/inc/breakpoint-assets.php

    r2374783 r3417088  
    1515
    1616        // enqueue scripts
    17         add_action( 'admin_enqueue_scripts', [$this, 'jltma_mcb_admin_enqueue_scripts'] );
     17        // add_action( 'admin_enqueue_scripts', [$this, 'jltma_mcb_admin_enqueue_scripts'] );
    1818
    1919        add_action('admin_head',[ $this, 'jltma_mcb_admin_styles' ]);
     
    2121
    2222
    23     // Custom Admin Styles for Master Custom Breakpoint page
     23    // Custom Admin Styles for Custom Breakpoint for Elementor page
    2424    public function jltma_mcb_admin_styles(){
    2525        $screen = get_current_screen();
    26         if($screen->id == 'master-addons_page_master-custom-breakpoints'){
     26        if($screen->id == 'master-addons_page_custom-breakpoints-for-elementor'){
    2727            $style = '#wpwrap{ background: #efeff5;
    2828                    margin-left: auto; margin-right: auto;
     
    5858        $screen = get_current_screen();
    5959
    60         if ( is_plugin_active( 'master-addons/master-elementor-addons.php' ) ) {
    61             $screen->id == 'master-addons_page_master-custom-breakpoints';
    62         } else{
    63             $screen->id == 'toplevel_page_master-custom-breakpoints';
    64         }
    65 
     60        $screen->id == 'toplevel_page_custom-breakpoints-for-elementor';
    6661
    6762        if($screen->id){
     
    7873                'plugin_url'    => JLTMA_MCB_PLUGIN_URL,
    7974                'ajaxurl'       => admin_url( 'admin-ajax.php' ),
    80                 'resturl'       => get_rest_url() . 'masteraddons/v2/'
     75                'resturl'       => get_rest_url() . 'masteraddons/v2/',
    8176            );
    8277            wp_localize_script( 'master-cbp-admin', 'masteraddons', $jltma_mcb_localize_data );
  • custom-breakpoints-for-elementor/tags/3.0.0/inc/hooks.php

    r2704815 r3417088  
    55use MasterCustomBreakPoint\JLTMA_Master_Custom_Breakpoint;
    66use Elementor\Plugin;
    7 
    87defined( 'ABSPATH' ) || exit;
    9 
    108class JLTMA_Master_Custom_Breakpoint_Hooks {
    11 
    129    public function __construct() {
    13 
    1410        add_action( 'admin_menu', [$this, 'jltma_mcb_menu'], 55 );
    15 
    16         // Import Settings
    17         add_action( 'wp_ajax_jltma_cbp_import_elementor_settings', [$this, 'jltma_cbp_import_elementor_settings']);
    18         add_action( 'wp_ajax_nopriv_jltma_cbp_import_elementor_settings', [$this, 'jltma_cbp_import_elementor_settings']);
    19 
    20         // Export Setttings
    21         add_action( 'admin_post_jltma_mcb_export_settings', [$this, 'jltma_mcb_export_settings']);
    22 
    2311        // Reset Form
    24         add_action( 'wp_ajax_jltma_mcb_reset_settings', [$this, 'jltma_mcb_reset_settings']);
    25         add_action( 'wp_ajax_nopriv_jltma_mcb_reset_settings', [$this, 'jltma_mcb_reset_settings']);
    26 
     12        add_action( 'wp_ajax_jltma_mcb_reset_settings', [$this, 'jltma_mcb_reset_settings'] );
    2713        // Save Breakpoint Settings
    28         add_action( 'wp_ajax_jltma_mcb_save_settings', [$this, 'jltma_mcb_save_settings']);
    29         add_action( 'wp_ajax_nopriv_jltma_mcb_save_settings', [ $this,'jltma_mcb_save_settings']);
    30 
    31         add_action( 'tgmpa_register', [$this,'jltma_mcb__register_required_plugins'] );
    32         add_action( 'admin_enqueue_scripts', [$this,'hooks_scripts'] );
    33 
     14        add_action( 'wp_ajax_jltma_mcb_save_settings', [$this, 'jltma_mcb_save_settings'] );
     15        add_action( 'tgmpa_register', [$this, 'jltma_mcb__register_required_plugins'] );
     16        add_action( 'admin_enqueue_scripts', [$this, 'hooks_scripts'] );
    3417    }
    3518
    3619    public function jltma_mcb_menu() {
    37 
    38         if ( ! function_exists( 'is_plugin_active' ) ) require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    39 
    40         $page_title = esc_html__('Master Custom Breakpoints', JLTMA_MCB_TD);
    41         $menu_title = esc_html__('Breakpoints', JLTMA_MCB_TD);
     20        if ( !function_exists( 'is_plugin_active' ) ) {
     21            require_once ABSPATH . '/wp-admin/includes/plugin.php';
     22        }
     23        $page_title = esc_html__( 'Custom Breakpoints for Elementor', JLTMA_MCB_TD );
     24        $menu_title = esc_html__( 'Breakpoints', JLTMA_MCB_TD );
    4225        $capability = 'manage_options';
    43         $menu_slug  = 'master-custom-breakpoints';
    44         $callback   = array( $this, 'jltma_mcb_content');
    45 
     26        $menu_slug = 'custom-breakpoints-for-elementor';
     27        $callback = array($this, 'jltma_mcb_content');
    4628        if ( is_plugin_active( 'master-addons/master-addons.php' ) || is_plugin_active( 'master-addons-pro/master-addons.php' ) ) {
    47             return add_submenu_page( 'master-addons-settings', $page_title, $menu_title, $capability, $menu_slug, $callback );
    48         }
    49        
    50         add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $callback, 'dashicons-desktop', 57 );
    51 
     29            return add_submenu_page(
     30                'master-addons-settings',
     31                $page_title,
     32                $menu_title,
     33                $capability,
     34                $menu_slug,
     35                $callback
     36            );
     37        }
     38        add_menu_page(
     39            $page_title,
     40            $menu_title,
     41            $capability,
     42            $menu_slug,
     43            $callback,
     44            'dashicons-desktop',
     45            57
     46        );
    5247    }
    5348
    5449    public function jltma_mcb_content() {
    55 
    56         if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
    57             echo esc_html__("Please Active Elementor Plugin", JLTMA_MCB_TD);
    58             return;
    59         }
    60 
    6150        ?>
    6251
    6352        <div class="jltma-wrap">
    64            
    65             <h2 style="margin-bottom: 15px;"><?php echo esc_html_e( JLTMA_Master_Custom_Breakpoint::$plugin_name, JLTMA_MCB_TD ); ?></h2>
    66 
    67             <em style="font-weight: 500;">
    68                 <?php echo esc_html_e( 'You can Drag and Drop Breakpoint positions. Make sure click "Save Settings"', JLTMA_MCB_TD ); ?>
    69             </em>
    70 
    71             <br><br>
    72 
    73             <?php if ( isset($_POST['updated']) && $_POST["updated"] === 'true' ) $this->handle_form(); ?>
     53
     54            <?php
     55        if ( isset( $_POST['updated'] ) && $_POST["updated"] === 'true' ) {
     56            $this->handle_form();
     57        }
     58        ?>
    7459
    7560            <form method="POST" class="jlmta-cbp-input-form" id="jlmta-cbp-form">
     
    7762                <div class="jltma-spinner"></div>
    7863
    79                 <?php wp_nonce_field( 'breakpoints_update', 'breakpoints_form' ); ?>
    80 
    81                 <div id="custom_breakpoints_page">
    82 
    83                     <div id="master_cbp_table" class="master_cbp_table">
    84        
    85                         <ul>
    86                             <li><?php echo esc_html__('Device Name', JLTMA_MCB_TD);?></li>
    87                             <li><?php echo esc_html__('Min-Width', JLTMA_MCB_TD);?></li>
    88                             <li><?php echo esc_html__('Max-Width', JLTMA_MCB_TD);?></li>
    89                             <li><?php echo esc_html__('Actions', JLTMA_MCB_TD);?></li>
    90                         </ul>
    91        
    92                         <ul :class="['breakpoint-row', breakpoint.isRecent ? 'breakpoint-is-recent' : '' ]" v-for="(breakpoint, index) in sorted_breakpoints" :key="index" :data-key="breakpoint.key">
    93        
    94                             <!-- Name -->
    95                             <li class="bp-name" :data-label="breakpoint.name">
    96                                 <input type="text" :name="breakpoint.name" :value="breakpoint.name" disabled v-if="in_array( breakpoint.key, default_devices )">
    97                                 <input type="text" :name="breakpoint.name" v-model="breakpoint.name" v-else>
    98                             </li>
    99        
    100                             <!-- Min Width -->
    101                             <li class="bp-min-width">
    102                                 <input type="number" :value="breakpoint.min" disabled>
    103                             </li>
    104        
    105                             <!-- Max Width -->
    106                             <li class="bp-max-width" v-if="in_array( breakpoint.key, default_devices )">
    107                                 <input type="number" disabled v-if="breakpoint.key == 'desktop'">
    108                                 <input type="number" :value="breakpoint.max" disabled v-else>
    109                             </li>
    110                             <li class="bp-max-width" v-else>
    111                                 <input class="jlma-mcb-model jlma-mcb-model--max" type="number" :value="breakpoint.max" @change="breakpoint_update($event, breakpoint)" @focus="input_focused(breakpoint)">
    112                             </li>
    113        
    114                             <!-- Actions -->
    115                             <li class="bp-actions">
    116                                 <div class="button button-primary jltma-cbp-remove" @click="remove_breakpoint(breakpoint.key)" v-if="!in_array( breakpoint.key, default_devices )">x</div>
    117                             </li>
    118        
    119                         </ul>
    120        
    121                     </div>
    122        
    123                     <?php
    124 
    125                     if ( function_exists( 'ma_el_fs' ) ) {
    126 
    127                         if ( ! ma_el_fs()->can_use_premium_code() ) {
    128                            
    129                             $pro_message = sprintf( __( '<a href="%1$s">Upgrade to Pro</a> for Unlimited Options. <a href="%1$s">Upgrade Now</a>', JLTMA_MCB_TD ), ma_el_fs()->get_upgrade_url() );
    130                             printf( '<div id="jltma-mcb-message" v-if="show_pro_message">%1$s</div>', $pro_message );
    131                             echo esc_html__( '', JLTMA_MCB_TD );
    132 
    133                         }
    134        
    135                     } else {
    136        
    137                         $pro_message = sprintf( __( '<a href="%1$s">Upgrade to Pro</a> for Unlimited Options. <a href="%1$s">Upgrade Now</a>', JLTMA_MCB_TD ), esc_url_raw('https://master-addons.com/pricing/') );
    138                         printf( '<div id="jltma-mcb-message" v-if="show_pro_message">%1$s</div>', $pro_message );
    139                         echo esc_html__( '', JLTMA_MCB_TD );
    140        
    141                     } ?>
    142        
    143                     <div class="submit">
    144                         <div :class="['button button-primary jltma-cbp-add', disable_add_breakpoint ? 'jltma-disabled' : '']" @click="add_breakpoint"><?php echo esc_html__('Add Breakpoint', JLTMA_MCB_TD);?></div>
    145                         <input type="submit" name="submit" id="submit" class="button button-primary jltma-cbp-save" value="<?php echo esc_html__('Save Breakpoints', JLTMA_MCB_TD);?>">
    146                     </div>
    147 
    148                 </div>
     64                <?php
     65        wp_nonce_field( 'breakpoints_update', 'breakpoints_form' );
     66        ?>
     67
     68
     69                <!-- React app renders here -->
     70                <div id="custom_breakpoints_page"></div>
    14971
    15072            </form>
    15173
    15274        </div>
    153 
    154         <div class="jltma-wrap">
    155 
    156             <h2><?php echo esc_html__('Breakpoint Settings', JLTMA_MCB_TD);?></h2>
    157 
    158             <div class="jltma-mcb-settings master_cbp_table <?php if ( function_exists( 'ma_el_fs' ) ) { if ( ! ma_el_fs()->can_use_premium_code() ) { echo "jltma-mcb-disabled"; } } else{ echo "jltma-mcb-disabled"; }?>">
    159 
    160                 <?php if ( function_exists( 'ma_el_fs' ) ) {
    161                     if ( ! ma_el_fs()->can_use_premium_code() ) {
    162                         echo '<span class="jltma-mcb-pro-badge eicon-pro-icon"></span>';
    163                     }
    164                 } else {
    165                     echo '<span class="jltma-mcb-pro-badge eicon-pro-icon"></span>';
    166                 } ?>
    167 
    168                 <ul>
    169                     <li>
    170                         <strong>
    171                             <?php echo esc_html__('Reset Settings', JLTMA_MCB_TD);?>
    172                         </strong>
    173                     </li>
    174                     <li>
    175                         <strong>
    176                             <?php echo esc_html__('Export Settings', JLTMA_MCB_TD);?>
    177                         </strong>
    178                     </li>
    179                     <li>
    180                         <strong>
    181                             <?php echo esc_html__('Import Settings', JLTMA_MCB_TD);?>
    182                         </strong>
    183                     </li>
    184                 </ul>
    185 
    186                 <ul>
    187                     <li data-label='Reset Settings'>
    188                         <div style="margin: 20px 0px;">
    189                             <form id="elementor_settings_reset_form" method="post">
    190                                 <?php wp_nonce_field( 'breakpoints_reset', 'reset_form' ); ?>
    191                                 <button type="submit" class="button button-primary jltma-cbp-reset">
    192                                     <?php echo esc_html__('Reset Settings', JLTMA_MCB_TD);?>
    193                                 </button>
    194                             </form>
    195 
    196                             <div id="reset_success" class='updated' style="display: none;">
    197                                 <p><?php echo esc_html__('Reset Settings', JLTMA_MCB_TD);?></p>
    198                             </div>
    199                         </div>
    200                         <br>
    201                     </li>
    202 
    203                     <li data-label='Export Settings'>
    204                         <div style="margin: 20px 0px;">
    205                             <div class="button button-primary jltma-cbp-add" onclick="window.open('admin-post.php?action=jltma_mcb_export_settings');">
    206                                 <?php echo esc_html__('Export Settings', JLTMA_MCB_TD);?>
    207                             </div>
    208                         </div>
    209                         <br>
    210                     </li>
    211 
    212                     <li>
    213                         <form id="elementor_settings_import_form" enctype="multipart/form-data" method="post">
    214                             <?php wp_nonce_field('jltma-mcb-import'); ?>
    215                             <input name="jltma_mcb" type="file" />
    216                             <input type="hidden" name="action" value="jltma_cbp_import_elementor_settings">
    217                             <br>
    218                             <button type="submit" class="button button-primary jltma-cbp-save">
    219                                 <?php echo esc_html__('Import Settings', JLTMA_MCB_TD);?>
    220                             </button>
    221                         </form>
    222 
    223                         <div id="elementor_import_success" class='updated' style="display: none;">
    224                             <p><?php echo esc_html__('Settings Imported', JLTMA_MCB_TD);?></p>
    225                         </div>
    226 
    227                     </li>
    228                 </ul>
    229 
    230             </div>
    231 
    232         </div>
    233 
    234         <?php
    235 
     75        <?php
    23676    }
    23777
    23878    public function jltma_mcb_save_settings() {
    239 
    240         if ( ! isset( $_POST['security'] ) || ! wp_verify_nonce( $_POST['security'], 'breakpoints_update' ) ) {
    241             wp_send_json_error(  esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
    242         }
    243 
    244         $form_fields = isset($_POST['form_fields']) ? $_POST['form_fields']: [];
    245        
     79        if ( !isset( $_POST['security'] ) || !wp_verify_nonce( $_POST['security'], 'breakpoints_update' ) ) {
     80            wp_send_json_error( esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
     81        }
     82        $form_fields = ( isset( $_POST['form_fields'] ) ? $_POST['form_fields'] : [] );
    24683        $custom_breakpoints = [];
    247 
    248         $free_limit = 2;
    249 
     84        $free_limit = 1;
     85        $is_pro = function_exists( 'jltma_cbfe' ) && jltma_cbfe()->can_use_premium_code__premium_only();
    25086        foreach ( $form_fields as $key => $value ) {
    251 
    252             if ( $value['default_value'] < 1 ) continue;
    253 
    254             if ( ! wp_validate_boolean( function_exists( 'ma_el_fs' ) && ma_el_fs()->can_use_premium_code() ) ) {
    255                 if ( count($custom_breakpoints) >= $free_limit ) continue;
     87            if ( $value['default_value'] < 1 ) {
     88                continue;
    25689            }
    257 
     90            // Pro users have unlimited breakpoints, free users limited to 1
     91            if ( !$is_pro ) {
     92                if ( count( $custom_breakpoints ) >= $free_limit ) {
     93                    continue;
     94                }
     95            }
    25896            $custom_breakpoints["breakpoint{$key}"] = [
    25997                'label'         => sanitize_text_field( $value['label'] ),
    26098                'default_value' => (int) $value['default_value'],
    261                 'direction'     => sanitize_text_field( $value['direction'] )
     99                'direction'     => sanitize_text_field( $value['direction'] ),
    262100            ];
    263 
    264         }
    265 
     101        }
    266102        update_option( 'jltma_mcb', $custom_breakpoints );
    267 
    268         die();
    269 
     103        die;
    270104    }
    271105
    272106    public function handle_form() {
    273 
    274107        // Save Breakpoints
    275         if( ! isset( $_POST['breakpoints_form'] ) || ! wp_verify_nonce( $_POST['breakpoints_form'], 'breakpoints_update' ) ){ ?>
     108        if ( !isset( $_POST['breakpoints_form'] ) || !wp_verify_nonce( $_POST['breakpoints_form'], 'breakpoints_update' ) ) {
     109            ?>
    276110            <div class="error">
    277111                <p>
    278                     <?php echo esc_html__('Sorry, your nonce was not correct. Please try again.', JLTMA_MCB_TD);?>
     112                    <?php
     113            echo esc_html__( 'Sorry, your nonce was not correct. Please try again.', JLTMA_MCB_TD );
     114            ?>
    279115                </p>
    280116            </div>
    281         <?php
     117        <?php 
    282118            exit;
    283119        } else {
    284 
    285120            $data_updated = false;
    286 
    287121            //CUSTOM BREAKPOINTS FILE SAVE
    288122            $custom_breakpoints = [];
    289 
    290             if (is_array($_REQUEST["breakpoint_select1"]) || is_object($_REQUEST["breakpoint_select1"])){
    291 
    292                 foreach($_REQUEST["breakpoint_select1"] as $key => $select1_value) {
     123            if ( is_array( $_REQUEST["breakpoint_select1"] ) || is_object( $_REQUEST["breakpoint_select1"] ) ) {
     124                foreach ( $_REQUEST["breakpoint_select1"] as $key => $select1_value ) {
    293125                    $custom_breakpoints["breakpoint{$key}"] = [
    294                         'name'          => sanitize_text_field($_REQUEST["breakpoint_name"][$key]),
    295                         // 'select1'       => sanitize_title($select1_value),
    296                         'input1'        => $_REQUEST["breakpoint_input1"][$key],
    297                         // 'select2'       => sanitize_title($_REQUEST["breakpoint_select2"][$key]),
    298                         'input2'        => $_REQUEST["breakpoint_input2"][$key],
    299                         'orientation'   => sanitize_title($_REQUEST["orientation"][$key])
     126                        'name'        => sanitize_text_field( $_REQUEST["breakpoint_name"][$key] ),
     127                        'input1'      => $_REQUEST["breakpoint_input1"][$key],
     128                        'input2'      => $_REQUEST["breakpoint_input2"][$key],
     129                        'orientation' => sanitize_title( $_REQUEST["orientation"][$key] ),
    300130                    ];
    301131                }
    302 
    303                 if(!empty($custom_breakpoints))
    304                     // $data_updated = file_put_contents( JLTMA_MCB_PLUGIN_PATH . '/custom_breakpoints.json', json_encode($custom_breakpoints));
     132                if ( !empty( $custom_breakpoints ) ) {
    305133                    update_option( 'jltma_mcb', $custom_breakpoints );
    306                     $data_updated = get_option( 'jltma_mcb', $custom_breakpoints );                   
    307 
     134                    $data_updated = get_option( 'jltma_mcb', $custom_breakpoints );
     135                }
    308136                //CUSTOM BREAKPOINTS SAVE END
    309                 if($data_updated) {
    310 
    311                     echo "
    312                         <div class='updated'>
    313                             <p>Saved Breakpoints</p>
    314                         </div>
    315                         <script>
    316                             jQuery(document).ready(function() {
    317                                setTimeout(function() {
    318                                     window.location.reload();
    319                                 }, 2000);
    320                             });
    321                         </script>
    322                     ";
    323 
     137                if ( $data_updated ) {
     138                    echo "\n                        <div class='updated'>\n                            <p>Saved Breakpoints</p>\n                        </div>\n                        <script>\n                            jQuery(document).ready(function() {\n                               setTimeout(function() {\n                                    window.location.reload();\n                                }, 2000);\n                            });\n                        </script>\n                    ";
    324139                } else {
    325                     echo "<div class='error'>
    326                             <p>Custom Breakpoints cannot be updated</p>
    327                         </div>";
     140                    echo "<div class='error'>\n                            <p>Custom Breakpoints cannot be updated</p>\n                        </div>";
    328141                }
    329142            }
    330143        }
    331 
    332144    }
    333145
    334146    // Reset Settings
    335147    public function jltma_mcb_reset_settings() {
    336 
    337         if ( ! isset( $_POST['security'] ) || ! wp_verify_nonce( $_POST['security'], 'breakpoints_reset' ) ) {
    338             wp_send_json_error(  esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
    339         }
    340 
     148        if ( !isset( $_POST['security'] ) || !wp_verify_nonce( $_POST['security'], 'breakpoints_reset' ) ) {
     149            wp_send_json_error( esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
     150        }
    341151        delete_option( 'jltma_mcb' );
    342         echo json_encode('ok');
    343         die();
    344 
    345     }
    346 
    347     // Export & Download Settins Files
    348     public function jltma_mcb_export_settings() {
    349 
    350         if( ! current_user_can( 'manage_options' ) )
    351             return;
    352 
    353         $settings = get_option( 'jltma_mcb' );
    354 
    355         ignore_user_abort( true );
    356 
    357         nocache_headers();
    358         header( 'Content-Type: application/json; charset=utf-8' );
    359         header( 'Content-Disposition: attachment; filename=master-custom-breakpoints-export-' . date( 'm-d-Y' ) . '.json' );
    360         header( "Expires: 0" );
    361 
    362         echo json_encode( $settings );
    363         exit;
    364 
    365     }
    366 
    367     // Import Files
    368     public function jltma_cbp_import_elementor_settings(){
    369 
    370         $extension = end( explode( '.', $_FILES['jltma_mcb']['name'] ) );
    371 
    372         if( $extension != 'json' ) {
    373             wp_die( __( 'Please upload a valid .json file' ) );
    374         }
    375 
    376         $import_file = $_FILES['jltma_mcb']['tmp_name'];
    377 
    378         if( empty( $import_file ) ) {
    379             wp_die( __( 'Please upload a file to import' ) );
    380         }
    381 
    382         // Retrieve the settings from the file and convert the json object to an array.
    383         $settings = (array) json_decode( file_get_contents( $import_file ) );
    384 
    385         update_option( 'jltma_mcb', $settings );
    386 
    387         echo json_encode('ok');
    388         die();
     152        echo json_encode( 'ok' );
     153        die;
    389154    }
    390155
     
    394159         * If the source is NOT from the .org repo, then source is also required.
    395160         */
    396 
    397         $plugins = [];
    398 
    399         if ( function_exists( 'ma_el_fs' ) ) {
    400             if( ma_el_fs()->can_use_premium_code()) {
    401                
    402                 $plugins = array(
    403                     array(
    404                             'name'               => esc_html__( 'Master Addons Pro', 'master-custom-breakpoint' ),
    405                             'slug'               => 'master-addons-pro',
    406                             'required'           => false,
    407                             'force_activation'   => false,
    408                         ),
    409                     array(
    410                             'name'               => esc_html__( 'Elementor', 'master-custom-breakpoint' ),
    411                             'slug'               => 'elementor',
    412                             'required'           => false,
    413                             'force_activation'   => false,
    414                         )
    415                     );
    416 
    417             }
    418         }else{
    419 
    420             $plugins = array(
    421                 array(
    422                         'name'               => esc_html__( 'Master Addons', 'master-custom-breakpoint' ),
    423                         'slug'               => 'master-addons',
    424                         'required'           => false,
    425                         'force_activation'   => false,
    426                     ),
    427                 array(
    428                         'name'               => esc_html__( 'Elementor', 'master-custom-breakpoint' ),
    429                         'slug'               => 'elementor',
    430                         'required'           => false,
    431                         'force_activation'   => false,
    432                     )
    433                 );               
    434         }
    435 
    436 
    437 
    438 
     161        $plugins = array(array(
     162            'name'             => esc_html__( 'Elementor', 'custom-breakpoints-for-elementor' ),
     163            'slug'             => 'elementor',
     164            'required'         => false,
     165            'force_activation' => false,
     166        ));
    439167        /*
    440168         * Array of configuration settings. Amend each line as needed.
     
    447175         */
    448176        $config = array(
    449             'id'           => 'master-custom-breakpoint',                 // Unique ID for hashing notices for multiple instances of TGMPA.
    450             'default_path' => '',                      // Default absolute path to bundled plugins.
    451             'menu'         => 'tgmpa-install-plugins', // Menu slug.
    452             'parent_slug'  => 'plugins.php',            // Parent menu slug.
    453             'capability'   => 'manage_options',    // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
    454             'has_notices'  => true,                    // Show admin notices or not.
    455             'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
    456             'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
    457             'is_automatic' => false,                   // Automatically activate plugins after installation or not.
    458             'message'      => '',                      // Message to output right before the plugins table.
    459 
    460            
     177            'id'           => 'custom-breakpoints-for-elementor',
     178            'default_path' => '',
     179            'menu'         => 'tgmpa-install-plugins',
     180            'parent_slug'  => 'plugins.php',
     181            'capability'   => 'manage_options',
     182            'has_notices'  => true,
     183            'dismissable'  => true,
     184            'dismiss_msg'  => '',
     185            'is_automatic' => false,
     186            'message'      => '',
    461187            'strings'      => array(
    462                 'page_title'                      => __( 'Install Required Plugins', 'master-custom-breakpoint' ),
    463                 'menu_title'                      => __( 'Install Plugins', 'master-custom-breakpoint' ),
    464                 'installing'                      => __( 'Installing Plugin: %s', 'master-custom-breakpoint' ),
    465                 'updating'                        => __( 'Updating Plugin: %s', 'master-custom-breakpoint' ),
    466                 'oops'                            => __( 'Something went wrong with the plugin API.', 'master-custom-breakpoint' ),
    467                 'notice_can_install_required'     => _n_noop(
    468                     'This theme requires the following plugin: %1$s.',
    469                     'This theme requires the following plugins: %1$s.',
    470                     'master-custom-breakpoint'
    471                 ),
    472                 'notice_can_install_recommended'  => _n_noop(
    473                     'This theme recommends the following plugin: %1$s.',
    474                     'This theme recommends the following plugins: %1$s.',
    475                     'master-custom-breakpoint'
    476                 ),
    477                 'notice_ask_to_update'            => _n_noop(
    478                     'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
    479                     'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
    480                     'master-custom-breakpoint'
    481                 ),
    482                 'notice_ask_to_update_maybe'      => _n_noop(
    483                     'There is an update available for: %1$s.',
    484                     'There are updates available for the following plugins: %1$s.',
    485                     'master-custom-breakpoint'
    486                 ),
    487                 'notice_can_activate_required'    => _n_noop(
    488                     'The following required plugin is currently inactive: %1$s.',
    489                     'The following required plugins are currently inactive: %1$s.',
    490                     'master-custom-breakpoint'
    491                 ),
    492                 'notice_can_activate_recommended' => _n_noop(
    493                     'The following recommended plugin is currently inactive: %1$s.',
    494                     'The following recommended plugins are currently inactive: %1$s.',
    495                     'master-custom-breakpoint'
    496                 ),
    497                 'install_link'                    => _n_noop(
    498                     'Begin installing plugin',
    499                     'Begin installing plugins',
    500                     'master-custom-breakpoint'
    501                 ),
    502                 'update_link'                     => _n_noop(
    503                     'Begin updating plugin',
    504                     'Begin updating plugins',
    505                     'master-custom-breakpoint'
    506                 ),
    507                 'activate_link'                   => _n_noop(
    508                     'Begin activating plugin',
    509                     'Begin activating plugins',
    510                     'master-custom-breakpoint'
    511                 ),
    512                 'return'                          => __( 'Return to Required Plugins Installer', 'master-custom-breakpoint' ),
    513                 'plugin_activated'                => __( 'Plugin activated successfully.', 'master-custom-breakpoint' ),
    514                 'activated_successfully'          => __( 'The following plugin was activated successfully:', 'master-custom-breakpoint' ),
    515                 'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.', 'master-custom-breakpoint' ),
    516                 'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'master-custom-breakpoint' ),
    517                 'complete'                        => __( 'All plugins installed and activated successfully. %1$s', 'master-custom-breakpoint' ),
    518                 'dismiss'                         => __( 'Dismiss this notice', 'master-custom-breakpoint' ),
    519                 'notice_cannot_install_activate'  => __( 'There are one or more required or recommended plugins to install, update or activate.', 'master-custom-breakpoint' ),
    520                 'contact_admin'                   => __( 'Please contact the administrator of this site for help.', 'master-custom-breakpoint' ),
    521 
    522                 'nag_type'                        => '', // Determines admin notice type - can only be one of the typical WP notice classes, such as 'updated', 'update-nag', 'notice-warning', 'notice-info' or 'error'. Some of which may not work as expected in older WP versions.
     188                'page_title'                      => __( 'Install Required Plugins', 'custom-breakpoints-for-elementor' ),
     189                'menu_title'                      => __( 'Install Plugins', 'custom-breakpoints-for-elementor' ),
     190                'installing'                      => __( 'Installing Plugin: %s', 'custom-breakpoints-for-elementor' ),
     191                'updating'                        => __( 'Updating Plugin: %s', 'custom-breakpoints-for-elementor' ),
     192                'oops'                            => __( 'Something went wrong with the plugin API.', 'custom-breakpoints-for-elementor' ),
     193                'notice_can_install_required'     => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'custom-breakpoints-for-elementor' ),
     194                'notice_can_install_recommended'  => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'custom-breakpoints-for-elementor' ),
     195                'notice_ask_to_update'            => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'custom-breakpoints-for-elementor' ),
     196                'notice_ask_to_update_maybe'      => _n_noop( 'There is an update available for: %1$s.', 'There are updates available for the following plugins: %1$s.', 'custom-breakpoints-for-elementor' ),
     197                'notice_can_activate_required'    => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'custom-breakpoints-for-elementor' ),
     198                'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'custom-breakpoints-for-elementor' ),
     199                'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'custom-breakpoints-for-elementor' ),
     200                'update_link'                     => _n_noop( 'Begin updating plugin', 'Begin updating plugins', 'custom-breakpoints-for-elementor' ),
     201                'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'custom-breakpoints-for-elementor' ),
     202                'return'                          => __( 'Return to Required Plugins Installer', 'custom-breakpoints-for-elementor' ),
     203                'plugin_activated'                => __( 'Plugin activated successfully.', 'custom-breakpoints-for-elementor' ),
     204                'activated_successfully'          => __( 'The following plugin was activated successfully:', 'custom-breakpoints-for-elementor' ),
     205                'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.', 'custom-breakpoints-for-elementor' ),
     206                'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'custom-breakpoints-for-elementor' ),
     207                'complete'                        => __( 'All plugins installed and activated successfully. %1$s', 'custom-breakpoints-for-elementor' ),
     208                'dismiss'                         => __( 'Dismiss this notice', 'custom-breakpoints-for-elementor' ),
     209                'notice_cannot_install_activate'  => __( 'There are one or more required or recommended plugins to install, update or activate.', 'custom-breakpoints-for-elementor' ),
     210                'contact_admin'                   => __( 'Please contact the administrator of this site for help.', 'custom-breakpoints-for-elementor' ),
     211                'nag_type'                        => '',
    523212            ),
    524            
    525213        );
    526 
    527214        tgmpa( $plugins, $config );
    528215    }
    529216
    530     public function hooks_scripts( $hook ) {
    531 
    532         if ( 'master-addons_page_master-custom-breakpoints' != $hook ) return;
    533 
    534         wp_register_script( 'jltma-vue-js', JLTMA_MCB_PLUGIN_URL . 'assets/js/vue.js', [], JLTMA_MCB_VERSION, true );
    535 
    536         wp_register_script( 'jltma-hooks-js', JLTMA_MCB_PLUGIN_URL . 'assets/js/hooks.js', ['jltma-vue-js', 'jquery'], JLTMA_MCB_VERSION, true );
    537 
     217    /**
     218     * Check if Elementor is active and loaded
     219     *
     220     * @return bool
     221     */
     222    public function is_elementor_active() {
     223        if ( !function_exists( 'is_plugin_active' ) ) {
     224            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     225        }
     226        return is_plugin_active( 'elementor/elementor.php' ) && did_action( 'elementor/loaded' ) && class_exists( '\\Elementor\\Plugin' );
     227    }
     228
     229    public function hooks_scripts() {
     230        // Check for the correct screen ID
     231        $screen = get_current_screen();
     232        // Only run on our plugin's admin page
     233        if ( $screen->id !== 'toplevel_page_custom-breakpoints-for-elementor' && $screen->id !== 'master-addons_page_custom-breakpoints-for-elementor' ) {
     234            return;
     235        }
     236        // Check if Elementor is active before proceeding
     237        if ( !$this->is_elementor_active() ) {
     238            return;
     239        }
     240        wp_enqueue_style( 'master-cbp-admin', JLTMA_MCB_PLUGIN_URL . 'assets/css/master-cbp-admin.css' );
     241        // Enqueue React admin script with wp-element dependency
     242        wp_enqueue_script(
     243            'jltma-breakpoints-admin',
     244            JLTMA_MCB_PLUGIN_URL . 'assets/js/breakpoints-admin.js',
     245            ['wp-element', 'jquery'],
     246            JLTMA_MCB_VERSION,
     247            true
     248        );
    538249        $breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints();
    539 
    540         $breakpoints = array_map( function( $breakpoint ) {
     250        $breakpoints = array_map( function ( $breakpoint ) {
    541251            return [
    542252                'name' => $breakpoint->get_label(),
    543                 'key' => $breakpoint->get_name(),
    544                 'max' => $breakpoint->get_default_value()
     253                'key'  => $breakpoint->get_name(),
     254                'max'  => $breakpoint->get_default_value(),
    545255            ];
    546256        }, $breakpoints );
    547 
    548         $default_breakpoints = array_keys(Plugin::$instance->breakpoints->get_default_config());
    549 
     257        $default_breakpoints = array_keys( Plugin::$instance->breakpoints->get_default_config() );
     258        $upgrade_url = jltma_cbfe()->get_upgrade_url();
    550259        $data = [
    551             'breakpoints' => array_values( $breakpoints ),
     260            'breakpoints'     => array_values( $breakpoints ),
    552261            'default_devices' => $default_breakpoints,
    553             'devices' => [],
    554             'is_pro' => wp_validate_boolean( function_exists( 'ma_el_fs' ) && ma_el_fs()->can_use_premium_code() )
     262            'ajaxurl'         => admin_url( 'admin-ajax.php' ),
     263            'upgrade_url'     => $upgrade_url,
     264            'reset_nonce'     => wp_create_nonce( "breakpoints_reset" ),
    555265        ];
    556 
    557         wp_localize_script( 'jltma-hooks-js', 'jltma_custom_bp_data', $data );
    558 
    559         wp_enqueue_script( 'jltma-hooks-js' );
    560 
     266        wp_localize_script( 'jltma-breakpoints-admin', 'jltma_custom_bp_data', $data );
    561267    }
    562268
  • custom-breakpoints-for-elementor/tags/3.0.0/lib/misc.php

    r2704815 r3417088  
    1313
    1414    public function __construct() {
    15        
     15
    1616        add_action( 'elementor/editor/wp_head', [$this, 'print_custom_scripts'] );
    1717
    1818        add_action( 'init', [$this, 'update_jltma_mcb_breakpoints'], 0 );
    1919
     20        // Swap Elementor's editor-app-bar.js with our patched version that includes icon fallbacks
     21        add_filter( 'script_loader_src', [$this, 'swap_editor_appbar_src'], 10, 2 );
     22
     23    }
     24
     25    /**
     26     * Swap Elementor's editor-app-bar.js with our patched version
     27     * The patched version includes width-based icon fallbacks for custom breakpoints
     28     */
     29    public function swap_editor_appbar_src( $src, $handle ) {
     30        if ( $handle === 'elementor-v2-editor-app-bar' ) {
     31            return JLTMA_MCB_PLUGIN_URL . 'assets/js/editor-app-bar.min.js?ver=' . JLTMA_MCB_VERSION;
     32        }
     33        return $src;
    2034    }
    2135
  • custom-breakpoints-for-elementor/tags/3.0.0/readme.txt

    r2704815 r3417088  
    33Tags: custom breakpoints,responsive, breakpoints, elementor, elementor breakpoints, elementor plugin, elementor addon, elementor responsive
    44Requires at least: 4.0
    5 Tested up to: 5.9.2
    6 Requires PHP: 5.6
     5Tested up to: 6.9
     6Requires PHP: 7.0
    77Stable tag: trunk
    88License: GPLv3 or later
     
    1515== Description ==
    1616
    17 [Custom Breakpoints for Elementor](https://master-addons.com/demos/custom-breakpoints/) assist you to target any kind of Devices like Mobile, Tablet, Laptop, Desktop responsive value to design your pages for those devices.
     17[Custom Breakpoints for Elementor](https://master-addons.com/custom-breakpoints/) assist you to target any kind of Devices like Mobile, Tablet, Laptop, Desktop responsive value to design your pages for those devices.
    1818
    1919
    2020> 17+ default breakpoints
    2121> Works Exact same as Elementors Breakpoints
    22 > No Breakpoints Limits (Unlitimited)
    23 > Drag & Drop Sorting Breakpoints
    24 > Export Option
    25 > Import Option
    26 > Reset Option
     22> No Breakpoints Limits (Pro Version)
     23> Set max-width for automatic sorting Breakpoint positions
     24> Export Breakpoints Option
     25> Import Breakpoints Option
     26> Reset Breakpoints Option
    2727> Multisite Supports
    2828
    29 Elementor Breakpoints will help you to create a responsive website perfectly fit to any device. By default, there are three breakpoints in Elementor. But it's not enough when you try to target devices with their specific min - max width. 
     29Elementor Breakpoints will help you to create a responsive website perfectly fit to any device. By default, there are three breakpoints in Elementor. But it's not enough when you try to target devices with their specific min - max width.
    3030
    3131> ## [Master Addons for Elementor](https://wordpress.org/plugins/master-addons/)
     
    3333>[All Addons](https://master-addons.com/all-widgets/) | [Support](https://master-addons.com/contact-us/) | [Docs](https://master-addons.com/docs/) | [Tutorials](https://www.youtube.com/watch?v=vWGWzuRKIss) | [Upgrade Pro](http://bit.ly/32n5dXS)
    3434
    35 This Custom Breakpoint plugin will help you to set a specific property of elements for your custom made breakpoint. Just install and activate the plugin and you able to see a new option inside elementor called "Breakpoints". 
     35This Custom Breakpoint plugin will help you to set a specific property of elements for your custom made breakpoint. Just install and activate the plugin and you able to see a new option inside elementor called "Breakpoints".
    3636
    37 Set your desired device value in the breakpoint and arrange pages properly. 
     37Set your desired device value in the breakpoint and arrange pages properly.
    3838
    3939== Elementor Custom Breakpoints ==
     
    9090
    9191= How to add a Custom Breakpoint? =
    92 Navigate to the breakpoint option. You will see default breakpoint there. Just customize the default breakpoint with your own value and property. You can add new breakpoint too. 
     92Navigate to the breakpoint option. You will see default breakpoint there. Just customize the default breakpoint with your own value and property. You can add new breakpoint too.
    9393
    9494= Is it compatible with any Theme? =
     
    101101== Screenshots ==
    1021021. Custom Breakpoints for Elementor
    103 2. Custom Breakpoint editor 
     1032. Custom Breakpoint editor
    104104
    105105
     
    110110Paste on your Local Computer
    1111113. Activate the "Custom Breakpoints for Elementor" Plugin through the 'Plugins' menu in WordPress
    112 
    113 
    114 
    115 == Changelog ==
    116 = 2.0.2 (5-04-2022)=
    117 * Updated: Fully re-coded with Latest Elementor Free and Elementor Pro Support
    118 
    119 
    120 = 1.0.6 (09-07-2021)=
    121 * Updated: Fully re-coded with latest Elementor Free and Elementor Pro Support
    122 
    123 = 1.0.6 (15-09-2020)=
    124 * Updated: Overlapping Devices popup to center. Will fit perfectly to any screen size. Now, it will not overlap with header and footer panels.
    125 * Added: Device Name added on popup tooltip
    126 * Fixed: elementorFrontend 'undefined' on console error
    127 * Added: Device rotation Portrait/Landscape version added
    128 * Support: Latest Elementor 3.0.10 version compatible and Elementor Pro compatibility
    129 
    130 
    131 = 1.0.6 (15-09-2020)=
    132 * Updated: Settings data saved Database now, for better performance
    133 * Updated: Reset Option Updated
    134 * Updated: Export Option Updated
    135 * Updated: Import Option Updated
    136 * Fixed: other related tweaks
    137 
    138 = 1.0.5 (13-09-2020)=
    139 * Fixed: TGM class conclict issue fixed
    140 * Fixed: TGM class conclict array $plugins issue fixed
    141 
    142 = 1.0.4 (04-09-2020)=
    143 * Fixed: Native Breakpoints support for Sections, Columns and all Elements
    144 * Added: Added feature to Import/Export Section/Template will also work
    145 * Fixed: Typography and other issues not working issue fixed
    146 * Updated: Given support for Elementor 2.x.x and v3.x.x, now it works seamlessly with any version
    147 
    148 
    149 = 1.0.3 (26-08-2020)=
    150 * Updated: Required plugins junk code removed and fixed with TGM.
    151 
    152 = 1.0.2 (26-08-2020)=
    153 * Initial Release
    154 
  • custom-breakpoints-for-elementor/trunk/assets/css/master-cbp-admin.css

    r2561184 r3417088  
    1 /* Master Custom Breakpoint */
    2 .jltma-wrap {
    3     width: 79%;
    4     align-items: center;
    5     margin-left: auto;
    6     margin-right: auto;
    7 }
    8 
    9 .master_cbp_table ul:nth-child(odd) {
    10     background: #f9f9f9;
    11     border-bottom: 1px solid #ececec;
    12 }
    13 
    14 .master_cbp_table ul:nth-child(even) {
    15   background: #fff;
    16 }
    17 
    18 .master_cbp_table ul.breakpoint-is-recent {
    19     background: #6a14d1;
    20 }
    21 
    22 #jltma-mcb-message {
    23     background: #fff;
    24     text-align: center;
    25     padding: 30px;
    26     color: #000;
    27     font-size: 25px;
    28     margin: 50px 0;
    29     border: 1px dashed #222;   
    30 }
    31 #jltma-mcb-message a {
    32     color:#fd1919;
    33     font-weight:bold;
    34     text-decoration:none;
    35 }
    36 
    37 .jltma-mcb-pro-badge {
    38     position: absolute;
    39     z-index: 333;
    40     text-align: center;
    41     padding-left: 36%;
    42     font-size: 100px !important;
    43     padding-top: 3%;
    44 }
    45 
    46 .jltma-mcb-disabled{
    47     pointer-events: none;
    48     opacity: 0.4;
    49 }
    50 @media screen and (min-width: 600px) {
    51     .jlmta-cbp-input-form {
    52         display: table;
    53     }
    54     .jltma-wrap h2{
    55         font-size: 30px;
    56         padding: 0px 0 0px;
    57     }
    58     .master_cbp_table ul {
    59         display: table-row;
    60     }
    61 
    62     .master_cbp_table ul:first-child li {
    63         background-color: #f7f7fa;
    64         color: #90a4ae;
    65         padding: 20px;
    66         font-size: 1.2em;
    67         font-family: sans-serif,'Poppins';
    68         line-height: 20px;
    69         border-bottom: none;   
    70     }
    71 
    72     .master_cbp_table ul > li {
    73         display: table-cell;
    74         padding: 20px;
    75     }
    76 
    77     .jltma-wrap .jltma-cbp-ex-imp-head{
    78         padding-top: 100px;
    79     }
    80    
    81     .master_cbp_table input[type=text],
    82     .master_cbp_table input[type=number],
    83     .master_cbp_table select{
    84         min-height: 35px;
    85         padding-left: 20px;
    86         border-radius: 22.5px;
    87         border: 1px solid #ededf2;
    88     }
    89 
    90     .master_cbp_table input[type=text]:focus,
    91     .master_cbp_table input[type=number]:focus,
    92     .master_cbp_table select:focus{
    93         box-shadow: 0 0px 15px 0 rgba(0, 0, 0, 0.1) !important;
    94     }
    95 
    96     .master_cbp_table .button.button-primary{
    97         border-radius: 50px;
    98         font-size: 22px;
    99         line-height: 25px;
    100         padding: 2px 11px 5px;
    101     }
    102     .jltma-wrap .button.button-primary{
    103         border-radius: 50px;
    104         font-size: 16px;
    105         padding: 0px 10px 0px;     
    106     }
    107     .jltma-mcb-settings .button.button-primary{
    108         font-size: 15px;
    109         padding: 5px 20px 5px;         
    110     }
    111     .jltma-mcb-settings .button.button-primary:focus,
    112     .jltma-mcb-settings .button.button-primary:active{
    113         background: #fd1919;
    114         border-color: #fd1919;
    115         outline: none;
    116     }
    117 
    118     .jltma-wrap .button.button-primary:focus{
    119         box-shadow: none;
    120     }
    121     .master_cbp_table .jltma-cbp-remove{
    122         background: #f67373;
    123         border-color: #f67373; 
    124         margin-top: -5px;
    125         outline: none;
    126     }
    127     .master_cbp_table .jltma-cbp-remove:hover{
    128         background: #fd1919 !important;
    129         border-color: #fd1919 !important;
    130         outline: none;
    131     }
    132     .jlmta-cbp-input-form .submit{
    133         float: right;
    134     }
    135     .jlmta-cbp-input-form .submit .button{
    136         border-radius: 22.5px;
    137         padding: 5px 20px;
    138         font-size: 14px;
    139         line-height: 30px;
    140     }
    141     .jlmta-cbp-input-form .jltma-cbp-add, .jltma-wrap .jltma-cbp-add, .jltma-mcb-settings .jltma-cbp-reset{
    142         background: #6a14d1;
    143         border-color: #6a14d1;
    144     }
    145     .jlmta-cbp-input-form .jltma-cbp-save, .jltma-wrap .jltma-cbp-save{
    146         background: #e8156e;
    147         border-color: #e8156e;
    148     }
    149     .jlmta-cbp-input-form .button.button-primary:hover, .jltma-wrap .jltma-cbp-add:hover, .jltma-mcb-settings .jltma-cbp-reset:hover{
    150         background: #41008e;
    151         border-color: #41008e;
    152         color: #fff;
    153     }
    154     .jlmta-cbp-input-form .submit .button.jltma-cbp-save:hover,
    155     .jlmta-cbp-input-form .submit .button.jltma-cbp-save:focus,
    156     .jlmta-cbp-input-form .submit .button.jltma-cbp-save:active,
    157     .jltma-wrap .jltma-cbp-save:hover{
    158         background: #fd1919;
    159         border-color: #fd1919;
    160         color: #fff;
    161     }
    162 
    163     .loading .master_cbp_table::before {
    164       opacity: .5;
    165       position: absolute;
    166       content: "";
    167       top: 0;
    168       left: 0;
    169       height: 100%;
    170       width: 100%;
    171       background-color: #fff;
    172 
    173       -webkit-transition: opaicty .5s ease;
    174       -o-transition: opaicty .5s ease;
    175       transition: opaicty .5s ease;
    176 
    177       z-index: 5;
    178       border-radius: inherit;
    179     }
    180     .jlmta-cbp-input-form .updated{
    181         opacity: 1;
    182     }
    183     .loading .jltma-spinner { display: block; }
    184 
    185 
    186 }
    187 
    188 /* small */
    189 @media screen and (max-width: 599px) {
    190   .master_cbp_table ul {
    191     border: solid 1px #ccc;
    192     display: block;
    193     list-style: none;
    194     margin: 1em;
    195     padding: 0.5em 1em;
    196   }
    197 
    198   .master_cbp_table ul:first-child {
    199     display: none;
    200   }
    201 
    202   .master_cbp_table ul > li {
    203     display: block;
    204     padding: 0.25em 0;
    205   }
    206   .master_cbp_table ul:nth-child(odd) > li + li {
    207     border-top: solid 1px #ccc;
    208   }
    209 
    210   .master_cbp_table ul:nth-child(even) > li + li {
    211     border-top: solid 1px #eee;
    212   }
    213 
    214   .master_cbp_table ul > li:before {
    215     color: #000;
    216     content: attr(data-label);
    217     display: inline-block;
    218     font-size: 75%;
    219     font-weight: bold;
    220     text-transform: capitalize;
    221     vertical-align: top;
    222     width: 50%;
    223   }
    224 
    225   .master_cbp_table p {
    226     margin: -1em 0 0 50%;
    227   }
    228 }
    229 
    230 /* tiny */
    231 @media screen and (max-width: 349px) {
    232   .master_cbp_table ul > li:before {
    233     display: block;
    234   }
    235 
    236   .master_cbp_table p {
    237     margin: 0;
    238   }
    239 }
    240 
     1@charset "UTF-8";.jltma-toaster-container{position:fixed;bottom:30px;left:50%;transform:translate(-50%);z-index:1000000;pointer-events:none;display:flex;flex-direction:column;align-items:center;gap:10px}.jltma-toaster{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;padding:16px 24px;border-radius:8px;box-shadow:0 10px 40px #667eea66;font-size:14px;font-weight:500;min-width:300px;max-width:500px;text-align:center;pointer-events:auto;animation:jltma-toaster-slide-up .3s ease-out;position:relative;overflow:hidden;display:flex;align-items:center;gap:10px}.jltma-toaster:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(135deg,rgba(255,255,255,.2) 0%,transparent 100%);pointer-events:none}.jltma-toaster.success{background:linear-gradient(135deg,#00b09b,#96c93d);box-shadow:0 10px 40px #00b09b66}.jltma-toaster.error{background:linear-gradient(135deg,#f85032,#e73827);box-shadow:0 10px 40px #f8503266}.jltma-toaster.warning{background:linear-gradient(135deg,#f7971e,#ffd200);box-shadow:0 10px 40px #f7971e66}.jltma-toaster.info{background:linear-gradient(135deg,#4facfe,#00f2fe);box-shadow:0 10px 40px #4facfe66}.jltma-toaster.jltma-toaster-exit{animation:jltma-toaster-slide-down .3s ease-out;opacity:0}.jltma-toaster .jltma-toaster-icon{flex-shrink:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-weight:700;position:relative;z-index:1}.jltma-toaster .jltma-toaster-icon svg{width:100%;height:100%;fill:currentColor}.jltma-toaster .jltma-toaster-icon.success-icon:before{content:"✓";font-size:18px;font-weight:700}.jltma-toaster .jltma-toaster-icon.error-icon:before{content:"✕";font-size:20px;font-weight:700}.jltma-toaster .jltma-toaster-icon.warning-icon:before{content:"!";font-size:20px;font-weight:700}.jltma-toaster .jltma-toaster-icon.info-icon:before{content:"i";font-size:18px;font-weight:700;font-style:italic}.jltma-toaster .jltma-toaster-content{flex:1;position:relative;z-index:1}.jltma-toaster .jltma-toaster-close{background:#fff3;border:none;color:currentColor;width:24px;height:24px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .3s ease;flex-shrink:0;position:relative;z-index:1}.jltma-toaster .jltma-toaster-close:hover{background:#ffffff4d}.jltma-toaster .jltma-toaster-close:before{content:"✕";font-size:12px;line-height:1}.jltma-toaster .jltma-toaster-progress{position:absolute;bottom:0;left:0;height:3px;background:#ffffff80;animation:jltma-toaster-progress 3s linear;animation-fill-mode:forwards}@keyframes jltma-toaster-slide-up{0%{transform:translateY(100px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes jltma-toaster-slide-down{0%{transform:translateY(0);opacity:1}to{transform:translateY(100px);opacity:0}}@keyframes jltma-toaster-progress{0%{width:100%}to{width:0}}.jltma_cbp_button{display:flex;align-items:center;justify-content:center;gap:4px;border-radius:22.5px;padding:5px 20px;line-height:30px;border:none;font-size:14px;font-weight:500;cursor:pointer;color:#fff;background:#6a14d1;transition:all .15s}.jltma_cbp_button:hover{background:#41008e}.jltma_cbp_button_secondary{background:#e8156e}.jltma_cbp_button_secondary:hover{background:#fd1919}.jltma_cbp_button_outline{color:#000;background:transparent;border:1px solid #6a14d1}.jltma_cbp_button_outline:hover{color:#fff;background:#6a14d1}.jltma-disabled{pointer-events:none;opacity:.5}#custom_breakpoints_page{margin-top:48px}#custom_breakpoints_page>h2{margin:0;font-size:32px}#custom_breakpoints_page>p{margin:14px 0 0}.jltma_cbp_wrapper{margin-top:32px;display:grid;grid-template-columns:1fr 300px;gap:32px}.jltma_cbp_wrapper .jltma_cbp_breakpoints{background:#fff;padding:24px;border-radius:8px;box-shadow:#959da533 0 8px 24px}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr 1fr 1fr 100px;font-size:16px;font-weight:500}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li{padding:12px;margin-bottom:0}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li:last-child{text-align:center}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li input:focus{outline:none;border:none;box-shadow:none}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li .jltma-cbp-remove{background:#f8d9d9;border-color:#fdb7b7;margin-top:-5px;outline:none;width:32px;height:32px;border-radius:100px;display:flex;align-items:center;justify-content:center;color:#000;transition:all .2s}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul li .jltma-cbp-remove:hover{color:#fff;background:#fd1919!important;border-color:#fd1919!important;outline:none}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul:nth-child(odd){background:#f9f9f9;border-bottom:1px solid #ececec}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul:nth-child(2n){background:#fff}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_table ul.jltma_cbp-is-recent{background:#6a14d1}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_submit-wrapper{display:flex;align-items:center;justify-content:space-between}.jltma_cbp_wrapper .jltma_cbp_breakpoints .jltma_cbp_submit-wrapper .jltma_cbp_right_buttons{display:flex;align-items:center;gap:12px}.jltma_cbp_wrapper .jltma_cbp_breakpoints #jltma-mcb-message{background:#fff;text-align:center;padding:30px;color:#000;font-size:25px;margin:50px 0;border:1px dashed #222}.jltma_cbp_wrapper .jltma_cbp_breakpoints #jltma-mcb-message a{color:#fd1919;font-weight:700;text-decoration:none}.jltma_cbp_settings{background:#fff;padding:24px;border-radius:8px;box-shadow:#959da533 0 8px 24px;position:relative}.jltma_cbp_settings .jltma_cbp_pro_settings{position:absolute;top:0;left:0;border-radius:8px;width:100%;height:100%;background:#0000003f;backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px);display:flex;align-items:center;justify-content:center}.jltma_cbp_settings .jltma_cbp_pro_settings span{display:inline-flex;align-items:center;justify-content:center;width:fit-content;gap:4px;padding:6px 10px;font-size:18px;font-weight:500;color:#fff;white-space:nowrap;background-color:#f97316;border:1px solid transparent;border-radius:6px;overflow:hidden;transition:color .15s,box-shadow .15s;-webkit-user-select:none;user-select:none;flex-shrink:0}.jltma_cbp_settings .jltma_cbp_pro_settings .jltma_cbp_settings_import{margin-top:16px}.jltma_cbp_settings .jltma_cbp_pro_settings .jltma_cbp_settings_import+.jltma_cbp_settings_export h3{margin:0}.jltma_cbp_settings .jltma_cbp_pro_settings .jltma_cbp_settings_import+.jltma_cbp_settings_export p{margin:12px 0 0}.jltma-wrap{width:79%;align-items:center;margin-left:auto;margin-right:auto}
  • custom-breakpoints-for-elementor/trunk/class-master-custom-breakpoint.php

    r2704815 r3417088  
    11<?php
     2
    23namespace MasterCustomBreakPoint;
    34
    45defined( 'ABSPATH' ) || exit;
     6if ( !class_exists( 'JLTMA_Master_Custom_Breakpoint' ) ) {
     7    class JLTMA_Master_Custom_Breakpoint {
     8        public $dir;
    59
    6 if( !class_exists('JLTMA_Master_Custom_Breakpoint') ){
     10        public $url;
    711
    8     class JLTMA_Master_Custom_Breakpoint{
     12        private static $plugin_path;
    913
    10         public $dir;
     14        private static $plugin_url;
    1115
    12         public $url;
     16        private static $_instance = null;
    1317
    14         private static $plugin_path;
     18        const MINIMUM_PHP_VERSION = '5.6';
    1519
    16         private static $plugin_url;
     20        const MINIMUM_ELEMENTOR_VERSION = '2.0.0';
    1721
    18         private static $_instance = null;
     22        public static $plugin_name = 'Elementor Breakpoints Extender';
    1923
    20         const MINIMUM_PHP_VERSION = '5.6';
     24        public function __construct() {
     25            $this->jltma_mcb_include_files();
     26            add_action( 'init', [$this, 'jltma_mcb_i18n'] );
     27            add_action( 'plugins_loaded', [$this, 'init'] );
     28        }
    2129
    22         const MINIMUM_ELEMENTOR_VERSION = '2.0.0';
     30        public function jltma_mcb_i18n() {
     31            load_plugin_textdomain( 'custom-breakpoints-for-elementor' );
     32        }
    2333
    24         public static $plugin_name = 'Elementor Breakpoints Extender';
     34        public function init() {
     35            // If 'is_plugin_active' function not found
     36            if ( !function_exists( 'is_plugin_active' ) ) {
     37                require_once ABSPATH . '/wp-admin/includes/plugin.php';
     38            }
     39            if ( is_plugin_active( 'elementor/elementor.php' ) ) {
     40                // Minimum supported Elementor version is 3.5.1+
     41                if ( version_compare( ELEMENTOR_VERSION, '3.5.1', '>=' ) ) {
     42                    include_once JLTMA_MCB_PLUGIN_PATH . 'lib/core/breakpoints/manager.php';
     43                    include_once JLTMA_MCB_PLUGIN_PATH . 'lib/misc.php';
     44                }
     45            }
     46            self::jltma_mcb_plugin_activation_hook();
     47        }
    2548
    26         public function __construct(){
     49        public function jltma_mcb_include_files() {
     50            if ( !class_exists( 'TGM_Plugin_Activation' ) ) {
     51                include JLTMA_MCB_PLUGIN_PATH . 'inc/class-tgm-plugin-activation.php';
     52            }
     53            include JLTMA_MCB_PLUGIN_PATH . 'inc/breakpoint-assets.php';
     54            include JLTMA_MCB_PLUGIN_PATH . 'inc/hooks.php';
     55        }
    2756
    28             $this->jltma_mcb_include_files();
     57        // Activation Hook
     58        public static function jltma_mcb_plugin_activation_hook() {
     59            if ( get_option( 'jltma_mcb_activation_time' ) === false ) {
     60                update_option( 'jltma_mcb_activation_time', strtotime( "now" ) );
     61            }
     62        }
    2963
    30             add_action( 'init', [ $this, 'jltma_mcb_i18n' ] );
     64        public function is_elementor_activated( $plugin_path = 'elementor/elementor.php' ) {
     65            $installed_plugins_list = get_plugins();
     66            return isset( $installed_plugins_list[$plugin_path] );
     67        }
    3168
    32             add_action( 'plugins_loaded', [ $this, 'init' ] );
     69        public static function get_instance() {
     70            if ( is_null( self::$_instance ) ) {
     71                self::$_instance = new self();
     72            }
     73            return self::$_instance;
     74        }
    3375
    34         }
     76    }
    3577
    36         public function jltma_mcb_i18n(){
    37             load_plugin_textdomain( 'master-custom-breakpoint' );
    38         }
    39 
    40         public function init(){
    41             // If 'is_plugin_active' function not found
    42             if ( ! function_exists( 'is_plugin_active' ) ){
    43                 require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    44             }
    45 
    46             if ( is_plugin_active( 'elementor/elementor.php' ) ) {
    47 
    48                 // Check if the Version between 2.9.0 to 3.0.0
    49                 if ( version_compare( ELEMENTOR_VERSION, '2.9.0', '>=' ) && version_compare( ELEMENTOR_VERSION, '3.0.0', '<' ) ) {
    50 
    51                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/base.php';
    52                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/frontend.php';
    53                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/responsive.php';
    54                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/controls-stack.php';
    55                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/stylesheet.php';
    56                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v2/editor.php';
    57 
    58                 } elseif ( version_compare( ELEMENTOR_VERSION, '3.0.0', '>' ) && version_compare( ELEMENTOR_VERSION, '3.2.4', '<' ) ) {
    59 
    60                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/base.php';
    61                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/responsive.php';
    62                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/controls-stack.php';
    63                     include_once JLTMA_MCB_PLUGIN_PATH .'lib-v32/editor.php';
    64 
    65                 } elseif ( version_compare( ELEMENTOR_VERSION, '3.2.4', '>=' ) && version_compare( ELEMENTOR_VERSION, '3.5.0', '<' ) ) {
    66 
    67                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/core/breakpoints/manager.php';
    68                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/core/breakpoints/breakpoint.php';
    69                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/core/editor/editor.php';
    70                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/includes/base/controls-stack.php';
    71                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib-v324/misc.php';
    72 
    73                 } elseif ( version_compare( ELEMENTOR_VERSION, '3.5.1', '>=' ) ) {
    74                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib/core/breakpoints/manager.php';
    75                     include_once JLTMA_MCB_PLUGIN_PATH . 'lib/misc.php';
    76                 }
    77                
    78             }
    79 
    80             self::jltma_mcb_plugin_activation_hook();
    81         }
    82 
    83 
    84         public function jltma_mcb_include_files(){
    85             if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
    86                 include JLTMA_MCB_PLUGIN_PATH . 'inc/class-tgm-plugin-activation.php';
    87             }
    88             include JLTMA_MCB_PLUGIN_PATH . 'inc/breakpoint-assets.php';
    89             include JLTMA_MCB_PLUGIN_PATH . 'inc/hooks.php';
    90         }
    91 
    92 
    93         // Activation Hook
    94         public static function jltma_mcb_plugin_activation_hook(){
    95 
    96             if (get_option('jltma_mcb_activation_time') === false)
    97                 update_option('jltma_mcb_activation_time', strtotime("now") );
    98 
    99 
    100             $custom_breakpoints = json_decode(file_get_contents( JLTMA_MCB_PLUGIN_PATH . '/custom_breakpoints.json'), true);
    101             if (get_option('jltma_mcb_activation_time') === false)
    102                 update_option('jltma_mcb', $custom_breakpoints );           
    103         }
    104 
    105         public function is_elementor_activated( $plugin_path = 'elementor/elementor.php' ) {
    106             $installed_plugins_list = get_plugins();
    107 
    108             return isset( $installed_plugins_list[ $plugin_path ] );
    109         }
    110 
    111 
    112         public static function get_instance() {
    113             if ( is_null( self::$_instance ) ) {
    114                 self::$_instance = new self();
    115             }
    116             return self::$_instance;
    117         }
    118     }
    11978}
    120 
    12179JLTMA_Master_Custom_Breakpoint::get_instance();
  • custom-breakpoints-for-elementor/trunk/custom-breakpoints-for-elementor.php

    r2704819 r3417088  
    11<?php
     2
    23/**
    34 * Plugin Name: Custom Breakpoints for Elementor
    4  * Description: Elementor Custom Breakpoint Created by <a href="https://master-addons.com/demos/custom-breakpoints/" target="_blank">Master Addons</a>
    5  * Plugin URI:  https://master-addons.com
    6  * Version:     2.0.2
     5 * Description: Elementor Custom Breakpoint Created by <a href="https://master-addons.com/custom-breakpoints/" target="_blank">Master Addons</a>
     6 * Plugin URI:  https://master-addons.com/
     7 * Version:     3.0.0
    78 * Author:      Jewel Theme
    8  * Author URI:  https://master-addons.com/demos/custom-breakpoints/
     9 * Author URI:  https://master-addons.com/custom-breakpoints/
    910 * License:     GPL-2.0+
    1011 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
    11  * Text Domain: master-custom-breakpoint
     12 * Text Domain: custom-breakpoints-for-elementor
    1213 * Domain Path: /languages
    13  * Elementor tested up to: 3.5.3
    14  * Elementor Pro tested up to: 3.5.0
     14 * Elementor tested up to: 3.33.4
     15 * Elementor Pro tested up to: 3.33.1
     16 *
    1517 */
     18defined( 'ABSPATH' ) || exit;
     19$jltma_custom_breakpoints_plugin_data = get_file_data( __FILE__, array(
     20    'Version'     => 'Version',
     21    'Plugin Name' => 'Plugin Name',
     22    'Author'      => 'Author',
     23    'Description' => 'Description',
     24    'Plugin URI'  => 'Plugin URI',
     25), false );
     26if ( !defined( 'JLTMA_MCB' ) ) {
     27    define( 'JLTMA_MCB', $jltma_custom_breakpoints_plugin_data['Plugin Name'] );
     28}
     29if ( !defined( 'JLTMA_MCB_PLUGIN_DESC' ) ) {
     30    define( 'JLTMA_MCB_PLUGIN_DESC', $jltma_custom_breakpoints_plugin_data['Description'] );
     31}
     32if ( !defined( 'JLTMA_MCB_VERSION' ) ) {
     33    define( 'JLTMA_MCB_VERSION', $jltma_custom_breakpoints_plugin_data['Version'] );
     34}
     35if ( !defined( 'JLTMA_MCB_TD' ) ) {
     36    define( 'JLTMA_MCB_TD', 'custom-breakpoints-for-elementor' );
     37}
     38if ( !defined( 'JLTMA_MCB_PLUGIN_PATH' ) ) {
     39    define( 'JLTMA_MCB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
     40}
     41if ( !defined( 'JLTMA_MCB_PLUGIN_URL' ) ) {
     42    define( 'JLTMA_MCB_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
     43}
     44if ( !defined( 'JLTMA_MCB_PLUGIN_DIR' ) ) {
     45    define( 'JLTMA_MCB_PLUGIN_DIR', plugin_basename( __FILE__ ) );
     46}
     47if ( !function_exists( 'jltma_cbfe' ) ) {
     48    // Create a helper function for easy SDK access.
     49    function jltma_cbfe() {
     50        global $jltma_cbfe;
     51        if ( !isset( $jltma_cbfe ) ) {
     52            // Activate multisite network integration.
     53            if ( !defined( 'WP_FS__PRODUCT_22184_MULTISITE' ) ) {
     54                define( 'WP_FS__PRODUCT_22184_MULTISITE', true );
     55            }
     56            // Include Freemius SDK.
     57            // SDK is auto-loaded through Composer
     58            // Include Freemius SDK.
     59            require_once __DIR__ . '/lib/freemius/start.php';
     60            $jltma_cbfe = fs_dynamic_init( array(
     61                'id'                  => '22184',
     62                'slug'                => 'custom-breakpoints-for-elementor',
     63                'type'                => 'plugin',
     64                'public_key'          => 'pk_6e6f38dff3de46f1129c72463e152',
     65                'is_premium'          => false,
     66                'has_addons'          => false,
     67                'has_paid_plans'      => true,
     68                'menu'                => array(
     69                    'slug'       => 'custom-breakpoints-for-elementor',
     70                    'first-path' => 'admin.php?page=custom-breakpoints-for-elementor',
     71                    'account'    => true,
     72                    'contact'    => false,
     73                    'pricing'    => true,
     74                    'support'    => false,
     75                ),
     76                'parallel_activation' => array(
     77                    'enabled'                  => true,
     78                    'premium_version_basename' => 'custom-breakpoints-for-elementor-premium/custom-breakpoints-for-elementor.php',
     79                ),
     80                'is_live'             => true,
     81            ) );
     82        }
     83        return $jltma_cbfe;
     84    }
    1685
    17 
    18 defined( 'ABSPATH' ) || exit;
    19 
    20 define( 'JLTMA_MCB_VERSION', '1.0.6' );
    21 define( 'JLTMA_MCB_TD', 'master-custom-breakpoint' );
    22 define( 'JLTMA_MCB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    23 define( 'JLTMA_MCB_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
    24 define( 'JLTMA_MCB_PLUGIN_DIR', plugin_basename( __FILE__ ) );
    25 
    26 
    27 require plugin_dir_path( __FILE__ ) . 'class-master-custom-breakpoint.php';
    28 
    29 
     86    // Init Freemius.
     87    jltma_cbfe();
     88    // Disable automatic plugin deactivation on activation
     89    jltma_cbfe()->add_filter( 'deactivate_on_activation', '__return_false' );
     90    // Signal that SDK was initiated.
     91    do_action( 'jltma_cbfe_loaded' );
     92}
    3093// Activation and Deactivation hooks
    31 if ( class_exists('\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint') ) {
    32     register_activation_hook( __FILE__ , array('\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint', 'jltma_mcb_plugin_activation_hook'));
     94if ( !class_exists( '\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint' ) ) {
     95    require JLTMA_MCB_PLUGIN_PATH . 'class-master-custom-breakpoint.php';
     96    register_activation_hook( __FILE__, array('\\MasterCustomBreakPoint\\JLTMA_Master_Custom_Breakpoint', 'jltma_mcb_plugin_activation_hook') );
    3397}
  • custom-breakpoints-for-elementor/trunk/inc/breakpoint-assets.php

    r2374783 r3417088  
    1515
    1616        // enqueue scripts
    17         add_action( 'admin_enqueue_scripts', [$this, 'jltma_mcb_admin_enqueue_scripts'] );
     17        // add_action( 'admin_enqueue_scripts', [$this, 'jltma_mcb_admin_enqueue_scripts'] );
    1818
    1919        add_action('admin_head',[ $this, 'jltma_mcb_admin_styles' ]);
     
    2121
    2222
    23     // Custom Admin Styles for Master Custom Breakpoint page
     23    // Custom Admin Styles for Custom Breakpoint for Elementor page
    2424    public function jltma_mcb_admin_styles(){
    2525        $screen = get_current_screen();
    26         if($screen->id == 'master-addons_page_master-custom-breakpoints'){
     26        if($screen->id == 'master-addons_page_custom-breakpoints-for-elementor'){
    2727            $style = '#wpwrap{ background: #efeff5;
    2828                    margin-left: auto; margin-right: auto;
     
    5858        $screen = get_current_screen();
    5959
    60         if ( is_plugin_active( 'master-addons/master-elementor-addons.php' ) ) {
    61             $screen->id == 'master-addons_page_master-custom-breakpoints';
    62         } else{
    63             $screen->id == 'toplevel_page_master-custom-breakpoints';
    64         }
    65 
     60        $screen->id == 'toplevel_page_custom-breakpoints-for-elementor';
    6661
    6762        if($screen->id){
     
    7873                'plugin_url'    => JLTMA_MCB_PLUGIN_URL,
    7974                'ajaxurl'       => admin_url( 'admin-ajax.php' ),
    80                 'resturl'       => get_rest_url() . 'masteraddons/v2/'
     75                'resturl'       => get_rest_url() . 'masteraddons/v2/',
    8176            );
    8277            wp_localize_script( 'master-cbp-admin', 'masteraddons', $jltma_mcb_localize_data );
  • custom-breakpoints-for-elementor/trunk/inc/hooks.php

    r2704815 r3417088  
    55use MasterCustomBreakPoint\JLTMA_Master_Custom_Breakpoint;
    66use Elementor\Plugin;
    7 
    87defined( 'ABSPATH' ) || exit;
    9 
    108class JLTMA_Master_Custom_Breakpoint_Hooks {
    11 
    129    public function __construct() {
    13 
    1410        add_action( 'admin_menu', [$this, 'jltma_mcb_menu'], 55 );
    15 
    16         // Import Settings
    17         add_action( 'wp_ajax_jltma_cbp_import_elementor_settings', [$this, 'jltma_cbp_import_elementor_settings']);
    18         add_action( 'wp_ajax_nopriv_jltma_cbp_import_elementor_settings', [$this, 'jltma_cbp_import_elementor_settings']);
    19 
    20         // Export Setttings
    21         add_action( 'admin_post_jltma_mcb_export_settings', [$this, 'jltma_mcb_export_settings']);
    22 
    2311        // Reset Form
    24         add_action( 'wp_ajax_jltma_mcb_reset_settings', [$this, 'jltma_mcb_reset_settings']);
    25         add_action( 'wp_ajax_nopriv_jltma_mcb_reset_settings', [$this, 'jltma_mcb_reset_settings']);
    26 
     12        add_action( 'wp_ajax_jltma_mcb_reset_settings', [$this, 'jltma_mcb_reset_settings'] );
    2713        // Save Breakpoint Settings
    28         add_action( 'wp_ajax_jltma_mcb_save_settings', [$this, 'jltma_mcb_save_settings']);
    29         add_action( 'wp_ajax_nopriv_jltma_mcb_save_settings', [ $this,'jltma_mcb_save_settings']);
    30 
    31         add_action( 'tgmpa_register', [$this,'jltma_mcb__register_required_plugins'] );
    32         add_action( 'admin_enqueue_scripts', [$this,'hooks_scripts'] );
    33 
     14        add_action( 'wp_ajax_jltma_mcb_save_settings', [$this, 'jltma_mcb_save_settings'] );
     15        add_action( 'tgmpa_register', [$this, 'jltma_mcb__register_required_plugins'] );
     16        add_action( 'admin_enqueue_scripts', [$this, 'hooks_scripts'] );
    3417    }
    3518
    3619    public function jltma_mcb_menu() {
    37 
    38         if ( ! function_exists( 'is_plugin_active' ) ) require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    39 
    40         $page_title = esc_html__('Master Custom Breakpoints', JLTMA_MCB_TD);
    41         $menu_title = esc_html__('Breakpoints', JLTMA_MCB_TD);
     20        if ( !function_exists( 'is_plugin_active' ) ) {
     21            require_once ABSPATH . '/wp-admin/includes/plugin.php';
     22        }
     23        $page_title = esc_html__( 'Custom Breakpoints for Elementor', JLTMA_MCB_TD );
     24        $menu_title = esc_html__( 'Breakpoints', JLTMA_MCB_TD );
    4225        $capability = 'manage_options';
    43         $menu_slug  = 'master-custom-breakpoints';
    44         $callback   = array( $this, 'jltma_mcb_content');
    45 
     26        $menu_slug = 'custom-breakpoints-for-elementor';
     27        $callback = array($this, 'jltma_mcb_content');
    4628        if ( is_plugin_active( 'master-addons/master-addons.php' ) || is_plugin_active( 'master-addons-pro/master-addons.php' ) ) {
    47             return add_submenu_page( 'master-addons-settings', $page_title, $menu_title, $capability, $menu_slug, $callback );
    48         }
    49        
    50         add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $callback, 'dashicons-desktop', 57 );
    51 
     29            return add_submenu_page(
     30                'master-addons-settings',
     31                $page_title,
     32                $menu_title,
     33                $capability,
     34                $menu_slug,
     35                $callback
     36            );
     37        }
     38        add_menu_page(
     39            $page_title,
     40            $menu_title,
     41            $capability,
     42            $menu_slug,
     43            $callback,
     44            'dashicons-desktop',
     45            57
     46        );
    5247    }
    5348
    5449    public function jltma_mcb_content() {
    55 
    56         if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
    57             echo esc_html__("Please Active Elementor Plugin", JLTMA_MCB_TD);
    58             return;
    59         }
    60 
    6150        ?>
    6251
    6352        <div class="jltma-wrap">
    64            
    65             <h2 style="margin-bottom: 15px;"><?php echo esc_html_e( JLTMA_Master_Custom_Breakpoint::$plugin_name, JLTMA_MCB_TD ); ?></h2>
    66 
    67             <em style="font-weight: 500;">
    68                 <?php echo esc_html_e( 'You can Drag and Drop Breakpoint positions. Make sure click "Save Settings"', JLTMA_MCB_TD ); ?>
    69             </em>
    70 
    71             <br><br>
    72 
    73             <?php if ( isset($_POST['updated']) && $_POST["updated"] === 'true' ) $this->handle_form(); ?>
     53
     54            <?php
     55        if ( isset( $_POST['updated'] ) && $_POST["updated"] === 'true' ) {
     56            $this->handle_form();
     57        }
     58        ?>
    7459
    7560            <form method="POST" class="jlmta-cbp-input-form" id="jlmta-cbp-form">
     
    7762                <div class="jltma-spinner"></div>
    7863
    79                 <?php wp_nonce_field( 'breakpoints_update', 'breakpoints_form' ); ?>
    80 
    81                 <div id="custom_breakpoints_page">
    82 
    83                     <div id="master_cbp_table" class="master_cbp_table">
    84        
    85                         <ul>
    86                             <li><?php echo esc_html__('Device Name', JLTMA_MCB_TD);?></li>
    87                             <li><?php echo esc_html__('Min-Width', JLTMA_MCB_TD);?></li>
    88                             <li><?php echo esc_html__('Max-Width', JLTMA_MCB_TD);?></li>
    89                             <li><?php echo esc_html__('Actions', JLTMA_MCB_TD);?></li>
    90                         </ul>
    91        
    92                         <ul :class="['breakpoint-row', breakpoint.isRecent ? 'breakpoint-is-recent' : '' ]" v-for="(breakpoint, index) in sorted_breakpoints" :key="index" :data-key="breakpoint.key">
    93        
    94                             <!-- Name -->
    95                             <li class="bp-name" :data-label="breakpoint.name">
    96                                 <input type="text" :name="breakpoint.name" :value="breakpoint.name" disabled v-if="in_array( breakpoint.key, default_devices )">
    97                                 <input type="text" :name="breakpoint.name" v-model="breakpoint.name" v-else>
    98                             </li>
    99        
    100                             <!-- Min Width -->
    101                             <li class="bp-min-width">
    102                                 <input type="number" :value="breakpoint.min" disabled>
    103                             </li>
    104        
    105                             <!-- Max Width -->
    106                             <li class="bp-max-width" v-if="in_array( breakpoint.key, default_devices )">
    107                                 <input type="number" disabled v-if="breakpoint.key == 'desktop'">
    108                                 <input type="number" :value="breakpoint.max" disabled v-else>
    109                             </li>
    110                             <li class="bp-max-width" v-else>
    111                                 <input class="jlma-mcb-model jlma-mcb-model--max" type="number" :value="breakpoint.max" @change="breakpoint_update($event, breakpoint)" @focus="input_focused(breakpoint)">
    112                             </li>
    113        
    114                             <!-- Actions -->
    115                             <li class="bp-actions">
    116                                 <div class="button button-primary jltma-cbp-remove" @click="remove_breakpoint(breakpoint.key)" v-if="!in_array( breakpoint.key, default_devices )">x</div>
    117                             </li>
    118        
    119                         </ul>
    120        
    121                     </div>
    122        
    123                     <?php
    124 
    125                     if ( function_exists( 'ma_el_fs' ) ) {
    126 
    127                         if ( ! ma_el_fs()->can_use_premium_code() ) {
    128                            
    129                             $pro_message = sprintf( __( '<a href="%1$s">Upgrade to Pro</a> for Unlimited Options. <a href="%1$s">Upgrade Now</a>', JLTMA_MCB_TD ), ma_el_fs()->get_upgrade_url() );
    130                             printf( '<div id="jltma-mcb-message" v-if="show_pro_message">%1$s</div>', $pro_message );
    131                             echo esc_html__( '', JLTMA_MCB_TD );
    132 
    133                         }
    134        
    135                     } else {
    136        
    137                         $pro_message = sprintf( __( '<a href="%1$s">Upgrade to Pro</a> for Unlimited Options. <a href="%1$s">Upgrade Now</a>', JLTMA_MCB_TD ), esc_url_raw('https://master-addons.com/pricing/') );
    138                         printf( '<div id="jltma-mcb-message" v-if="show_pro_message">%1$s</div>', $pro_message );
    139                         echo esc_html__( '', JLTMA_MCB_TD );
    140        
    141                     } ?>
    142        
    143                     <div class="submit">
    144                         <div :class="['button button-primary jltma-cbp-add', disable_add_breakpoint ? 'jltma-disabled' : '']" @click="add_breakpoint"><?php echo esc_html__('Add Breakpoint', JLTMA_MCB_TD);?></div>
    145                         <input type="submit" name="submit" id="submit" class="button button-primary jltma-cbp-save" value="<?php echo esc_html__('Save Breakpoints', JLTMA_MCB_TD);?>">
    146                     </div>
    147 
    148                 </div>
     64                <?php
     65        wp_nonce_field( 'breakpoints_update', 'breakpoints_form' );
     66        ?>
     67
     68
     69                <!-- React app renders here -->
     70                <div id="custom_breakpoints_page"></div>
    14971
    15072            </form>
    15173
    15274        </div>
    153 
    154         <div class="jltma-wrap">
    155 
    156             <h2><?php echo esc_html__('Breakpoint Settings', JLTMA_MCB_TD);?></h2>
    157 
    158             <div class="jltma-mcb-settings master_cbp_table <?php if ( function_exists( 'ma_el_fs' ) ) { if ( ! ma_el_fs()->can_use_premium_code() ) { echo "jltma-mcb-disabled"; } } else{ echo "jltma-mcb-disabled"; }?>">
    159 
    160                 <?php if ( function_exists( 'ma_el_fs' ) ) {
    161                     if ( ! ma_el_fs()->can_use_premium_code() ) {
    162                         echo '<span class="jltma-mcb-pro-badge eicon-pro-icon"></span>';
    163                     }
    164                 } else {
    165                     echo '<span class="jltma-mcb-pro-badge eicon-pro-icon"></span>';
    166                 } ?>
    167 
    168                 <ul>
    169                     <li>
    170                         <strong>
    171                             <?php echo esc_html__('Reset Settings', JLTMA_MCB_TD);?>
    172                         </strong>
    173                     </li>
    174                     <li>
    175                         <strong>
    176                             <?php echo esc_html__('Export Settings', JLTMA_MCB_TD);?>
    177                         </strong>
    178                     </li>
    179                     <li>
    180                         <strong>
    181                             <?php echo esc_html__('Import Settings', JLTMA_MCB_TD);?>
    182                         </strong>
    183                     </li>
    184                 </ul>
    185 
    186                 <ul>
    187                     <li data-label='Reset Settings'>
    188                         <div style="margin: 20px 0px;">
    189                             <form id="elementor_settings_reset_form" method="post">
    190                                 <?php wp_nonce_field( 'breakpoints_reset', 'reset_form' ); ?>
    191                                 <button type="submit" class="button button-primary jltma-cbp-reset">
    192                                     <?php echo esc_html__('Reset Settings', JLTMA_MCB_TD);?>
    193                                 </button>
    194                             </form>
    195 
    196                             <div id="reset_success" class='updated' style="display: none;">
    197                                 <p><?php echo esc_html__('Reset Settings', JLTMA_MCB_TD);?></p>
    198                             </div>
    199                         </div>
    200                         <br>
    201                     </li>
    202 
    203                     <li data-label='Export Settings'>
    204                         <div style="margin: 20px 0px;">
    205                             <div class="button button-primary jltma-cbp-add" onclick="window.open('admin-post.php?action=jltma_mcb_export_settings');">
    206                                 <?php echo esc_html__('Export Settings', JLTMA_MCB_TD);?>
    207                             </div>
    208                         </div>
    209                         <br>
    210                     </li>
    211 
    212                     <li>
    213                         <form id="elementor_settings_import_form" enctype="multipart/form-data" method="post">
    214                             <?php wp_nonce_field('jltma-mcb-import'); ?>
    215                             <input name="jltma_mcb" type="file" />
    216                             <input type="hidden" name="action" value="jltma_cbp_import_elementor_settings">
    217                             <br>
    218                             <button type="submit" class="button button-primary jltma-cbp-save">
    219                                 <?php echo esc_html__('Import Settings', JLTMA_MCB_TD);?>
    220                             </button>
    221                         </form>
    222 
    223                         <div id="elementor_import_success" class='updated' style="display: none;">
    224                             <p><?php echo esc_html__('Settings Imported', JLTMA_MCB_TD);?></p>
    225                         </div>
    226 
    227                     </li>
    228                 </ul>
    229 
    230             </div>
    231 
    232         </div>
    233 
    234         <?php
    235 
     75        <?php
    23676    }
    23777
    23878    public function jltma_mcb_save_settings() {
    239 
    240         if ( ! isset( $_POST['security'] ) || ! wp_verify_nonce( $_POST['security'], 'breakpoints_update' ) ) {
    241             wp_send_json_error(  esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
    242         }
    243 
    244         $form_fields = isset($_POST['form_fields']) ? $_POST['form_fields']: [];
    245        
     79        if ( !isset( $_POST['security'] ) || !wp_verify_nonce( $_POST['security'], 'breakpoints_update' ) ) {
     80            wp_send_json_error( esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
     81        }
     82        $form_fields = ( isset( $_POST['form_fields'] ) ? $_POST['form_fields'] : [] );
    24683        $custom_breakpoints = [];
    247 
    248         $free_limit = 2;
    249 
     84        $free_limit = 1;
     85        $is_pro = function_exists( 'jltma_cbfe' ) && jltma_cbfe()->can_use_premium_code__premium_only();
    25086        foreach ( $form_fields as $key => $value ) {
    251 
    252             if ( $value['default_value'] < 1 ) continue;
    253 
    254             if ( ! wp_validate_boolean( function_exists( 'ma_el_fs' ) && ma_el_fs()->can_use_premium_code() ) ) {
    255                 if ( count($custom_breakpoints) >= $free_limit ) continue;
     87            if ( $value['default_value'] < 1 ) {
     88                continue;
    25689            }
    257 
     90            // Pro users have unlimited breakpoints, free users limited to 1
     91            if ( !$is_pro ) {
     92                if ( count( $custom_breakpoints ) >= $free_limit ) {
     93                    continue;
     94                }
     95            }
    25896            $custom_breakpoints["breakpoint{$key}"] = [
    25997                'label'         => sanitize_text_field( $value['label'] ),
    26098                'default_value' => (int) $value['default_value'],
    261                 'direction'     => sanitize_text_field( $value['direction'] )
     99                'direction'     => sanitize_text_field( $value['direction'] ),
    262100            ];
    263 
    264         }
    265 
     101        }
    266102        update_option( 'jltma_mcb', $custom_breakpoints );
    267 
    268         die();
    269 
     103        die;
    270104    }
    271105
    272106    public function handle_form() {
    273 
    274107        // Save Breakpoints
    275         if( ! isset( $_POST['breakpoints_form'] ) || ! wp_verify_nonce( $_POST['breakpoints_form'], 'breakpoints_update' ) ){ ?>
     108        if ( !isset( $_POST['breakpoints_form'] ) || !wp_verify_nonce( $_POST['breakpoints_form'], 'breakpoints_update' ) ) {
     109            ?>
    276110            <div class="error">
    277111                <p>
    278                     <?php echo esc_html__('Sorry, your nonce was not correct. Please try again.', JLTMA_MCB_TD);?>
     112                    <?php
     113            echo esc_html__( 'Sorry, your nonce was not correct. Please try again.', JLTMA_MCB_TD );
     114            ?>
    279115                </p>
    280116            </div>
    281         <?php
     117        <?php 
    282118            exit;
    283119        } else {
    284 
    285120            $data_updated = false;
    286 
    287121            //CUSTOM BREAKPOINTS FILE SAVE
    288122            $custom_breakpoints = [];
    289 
    290             if (is_array($_REQUEST["breakpoint_select1"]) || is_object($_REQUEST["breakpoint_select1"])){
    291 
    292                 foreach($_REQUEST["breakpoint_select1"] as $key => $select1_value) {
     123            if ( is_array( $_REQUEST["breakpoint_select1"] ) || is_object( $_REQUEST["breakpoint_select1"] ) ) {
     124                foreach ( $_REQUEST["breakpoint_select1"] as $key => $select1_value ) {
    293125                    $custom_breakpoints["breakpoint{$key}"] = [
    294                         'name'          => sanitize_text_field($_REQUEST["breakpoint_name"][$key]),
    295                         // 'select1'       => sanitize_title($select1_value),
    296                         'input1'        => $_REQUEST["breakpoint_input1"][$key],
    297                         // 'select2'       => sanitize_title($_REQUEST["breakpoint_select2"][$key]),
    298                         'input2'        => $_REQUEST["breakpoint_input2"][$key],
    299                         'orientation'   => sanitize_title($_REQUEST["orientation"][$key])
     126                        'name'        => sanitize_text_field( $_REQUEST["breakpoint_name"][$key] ),
     127                        'input1'      => $_REQUEST["breakpoint_input1"][$key],
     128                        'input2'      => $_REQUEST["breakpoint_input2"][$key],
     129                        'orientation' => sanitize_title( $_REQUEST["orientation"][$key] ),
    300130                    ];
    301131                }
    302 
    303                 if(!empty($custom_breakpoints))
    304                     // $data_updated = file_put_contents( JLTMA_MCB_PLUGIN_PATH . '/custom_breakpoints.json', json_encode($custom_breakpoints));
     132                if ( !empty( $custom_breakpoints ) ) {
    305133                    update_option( 'jltma_mcb', $custom_breakpoints );
    306                     $data_updated = get_option( 'jltma_mcb', $custom_breakpoints );                   
    307 
     134                    $data_updated = get_option( 'jltma_mcb', $custom_breakpoints );
     135                }
    308136                //CUSTOM BREAKPOINTS SAVE END
    309                 if($data_updated) {
    310 
    311                     echo "
    312                         <div class='updated'>
    313                             <p>Saved Breakpoints</p>
    314                         </div>
    315                         <script>
    316                             jQuery(document).ready(function() {
    317                                setTimeout(function() {
    318                                     window.location.reload();
    319                                 }, 2000);
    320                             });
    321                         </script>
    322                     ";
    323 
     137                if ( $data_updated ) {
     138                    echo "\n                        <div class='updated'>\n                            <p>Saved Breakpoints</p>\n                        </div>\n                        <script>\n                            jQuery(document).ready(function() {\n                               setTimeout(function() {\n                                    window.location.reload();\n                                }, 2000);\n                            });\n                        </script>\n                    ";
    324139                } else {
    325                     echo "<div class='error'>
    326                             <p>Custom Breakpoints cannot be updated</p>
    327                         </div>";
     140                    echo "<div class='error'>\n                            <p>Custom Breakpoints cannot be updated</p>\n                        </div>";
    328141                }
    329142            }
    330143        }
    331 
    332144    }
    333145
    334146    // Reset Settings
    335147    public function jltma_mcb_reset_settings() {
    336 
    337         if ( ! isset( $_POST['security'] ) || ! wp_verify_nonce( $_POST['security'], 'breakpoints_reset' ) ) {
    338             wp_send_json_error(  esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
    339         }
    340 
     148        if ( !isset( $_POST['security'] ) || !wp_verify_nonce( $_POST['security'], 'breakpoints_reset' ) ) {
     149            wp_send_json_error( esc_html__( 'Security Error.', JLTMA_MCB_TD ) );
     150        }
    341151        delete_option( 'jltma_mcb' );
    342         echo json_encode('ok');
    343         die();
    344 
    345     }
    346 
    347     // Export & Download Settins Files
    348     public function jltma_mcb_export_settings() {
    349 
    350         if( ! current_user_can( 'manage_options' ) )
    351             return;
    352 
    353         $settings = get_option( 'jltma_mcb' );
    354 
    355         ignore_user_abort( true );
    356 
    357         nocache_headers();
    358         header( 'Content-Type: application/json; charset=utf-8' );
    359         header( 'Content-Disposition: attachment; filename=master-custom-breakpoints-export-' . date( 'm-d-Y' ) . '.json' );
    360         header( "Expires: 0" );
    361 
    362         echo json_encode( $settings );
    363         exit;
    364 
    365     }
    366 
    367     // Import Files
    368     public function jltma_cbp_import_elementor_settings(){
    369 
    370         $extension = end( explode( '.', $_FILES['jltma_mcb']['name'] ) );
    371 
    372         if( $extension != 'json' ) {
    373             wp_die( __( 'Please upload a valid .json file' ) );
    374         }
    375 
    376         $import_file = $_FILES['jltma_mcb']['tmp_name'];
    377 
    378         if( empty( $import_file ) ) {
    379             wp_die( __( 'Please upload a file to import' ) );
    380         }
    381 
    382         // Retrieve the settings from the file and convert the json object to an array.
    383         $settings = (array) json_decode( file_get_contents( $import_file ) );
    384 
    385         update_option( 'jltma_mcb', $settings );
    386 
    387         echo json_encode('ok');
    388         die();
     152        echo json_encode( 'ok' );
     153        die;
    389154    }
    390155
     
    394159         * If the source is NOT from the .org repo, then source is also required.
    395160         */
    396 
    397         $plugins = [];
    398 
    399         if ( function_exists( 'ma_el_fs' ) ) {
    400             if( ma_el_fs()->can_use_premium_code()) {
    401                
    402                 $plugins = array(
    403                     array(
    404                             'name'               => esc_html__( 'Master Addons Pro', 'master-custom-breakpoint' ),
    405                             'slug'               => 'master-addons-pro',
    406                             'required'           => false,
    407                             'force_activation'   => false,
    408                         ),
    409                     array(
    410                             'name'               => esc_html__( 'Elementor', 'master-custom-breakpoint' ),
    411                             'slug'               => 'elementor',
    412                             'required'           => false,
    413                             'force_activation'   => false,
    414                         )
    415                     );
    416 
    417             }
    418         }else{
    419 
    420             $plugins = array(
    421                 array(
    422                         'name'               => esc_html__( 'Master Addons', 'master-custom-breakpoint' ),
    423                         'slug'               => 'master-addons',
    424                         'required'           => false,
    425                         'force_activation'   => false,
    426                     ),
    427                 array(
    428                         'name'               => esc_html__( 'Elementor', 'master-custom-breakpoint' ),
    429                         'slug'               => 'elementor',
    430                         'required'           => false,
    431                         'force_activation'   => false,
    432                     )
    433                 );               
    434         }
    435 
    436 
    437 
    438 
     161        $plugins = array(array(
     162            'name'             => esc_html__( 'Elementor', 'custom-breakpoints-for-elementor' ),
     163            'slug'             => 'elementor',
     164            'required'         => false,
     165            'force_activation' => false,
     166        ));
    439167        /*
    440168         * Array of configuration settings. Amend each line as needed.
     
    447175         */
    448176        $config = array(
    449             'id'           => 'master-custom-breakpoint',                 // Unique ID for hashing notices for multiple instances of TGMPA.
    450             'default_path' => '',                      // Default absolute path to bundled plugins.
    451             'menu'         => 'tgmpa-install-plugins', // Menu slug.
    452             'parent_slug'  => 'plugins.php',            // Parent menu slug.
    453             'capability'   => 'manage_options',    // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
    454             'has_notices'  => true,                    // Show admin notices or not.
    455             'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
    456             'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
    457             'is_automatic' => false,                   // Automatically activate plugins after installation or not.
    458             'message'      => '',                      // Message to output right before the plugins table.
    459 
    460            
     177            'id'           => 'custom-breakpoints-for-elementor',
     178            'default_path' => '',
     179            'menu'         => 'tgmpa-install-plugins',
     180            'parent_slug'  => 'plugins.php',
     181            'capability'   => 'manage_options',
     182            'has_notices'  => true,
     183            'dismissable'  => true,
     184            'dismiss_msg'  => '',
     185            'is_automatic' => false,
     186            'message'      => '',
    461187            'strings'      => array(
    462                 'page_title'                      => __( 'Install Required Plugins', 'master-custom-breakpoint' ),
    463                 'menu_title'                      => __( 'Install Plugins', 'master-custom-breakpoint' ),
    464                 'installing'                      => __( 'Installing Plugin: %s', 'master-custom-breakpoint' ),
    465                 'updating'                        => __( 'Updating Plugin: %s', 'master-custom-breakpoint' ),
    466                 'oops'                            => __( 'Something went wrong with the plugin API.', 'master-custom-breakpoint' ),
    467                 'notice_can_install_required'     => _n_noop(
    468                     'This theme requires the following plugin: %1$s.',
    469                     'This theme requires the following plugins: %1$s.',
    470                     'master-custom-breakpoint'
    471                 ),
    472                 'notice_can_install_recommended'  => _n_noop(
    473                     'This theme recommends the following plugin: %1$s.',
    474                     'This theme recommends the following plugins: %1$s.',
    475                     'master-custom-breakpoint'
    476                 ),
    477                 'notice_ask_to_update'            => _n_noop(
    478                     'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
    479                     'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
    480                     'master-custom-breakpoint'
    481                 ),
    482                 'notice_ask_to_update_maybe'      => _n_noop(
    483                     'There is an update available for: %1$s.',
    484                     'There are updates available for the following plugins: %1$s.',
    485                     'master-custom-breakpoint'
    486                 ),
    487                 'notice_can_activate_required'    => _n_noop(
    488                     'The following required plugin is currently inactive: %1$s.',
    489                     'The following required plugins are currently inactive: %1$s.',
    490                     'master-custom-breakpoint'
    491                 ),
    492                 'notice_can_activate_recommended' => _n_noop(
    493                     'The following recommended plugin is currently inactive: %1$s.',
    494                     'The following recommended plugins are currently inactive: %1$s.',
    495                     'master-custom-breakpoint'
    496                 ),
    497                 'install_link'                    => _n_noop(
    498                     'Begin installing plugin',
    499                     'Begin installing plugins',
    500                     'master-custom-breakpoint'
    501                 ),
    502                 'update_link'                     => _n_noop(
    503                     'Begin updating plugin',
    504                     'Begin updating plugins',
    505                     'master-custom-breakpoint'
    506                 ),
    507                 'activate_link'                   => _n_noop(
    508                     'Begin activating plugin',
    509                     'Begin activating plugins',
    510                     'master-custom-breakpoint'
    511                 ),
    512                 'return'                          => __( 'Return to Required Plugins Installer', 'master-custom-breakpoint' ),
    513                 'plugin_activated'                => __( 'Plugin activated successfully.', 'master-custom-breakpoint' ),
    514                 'activated_successfully'          => __( 'The following plugin was activated successfully:', 'master-custom-breakpoint' ),
    515                 'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.', 'master-custom-breakpoint' ),
    516                 'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'master-custom-breakpoint' ),
    517                 'complete'                        => __( 'All plugins installed and activated successfully. %1$s', 'master-custom-breakpoint' ),
    518                 'dismiss'                         => __( 'Dismiss this notice', 'master-custom-breakpoint' ),
    519                 'notice_cannot_install_activate'  => __( 'There are one or more required or recommended plugins to install, update or activate.', 'master-custom-breakpoint' ),
    520                 'contact_admin'                   => __( 'Please contact the administrator of this site for help.', 'master-custom-breakpoint' ),
    521 
    522                 'nag_type'                        => '', // Determines admin notice type - can only be one of the typical WP notice classes, such as 'updated', 'update-nag', 'notice-warning', 'notice-info' or 'error'. Some of which may not work as expected in older WP versions.
     188                'page_title'                      => __( 'Install Required Plugins', 'custom-breakpoints-for-elementor' ),
     189                'menu_title'                      => __( 'Install Plugins', 'custom-breakpoints-for-elementor' ),
     190                'installing'                      => __( 'Installing Plugin: %s', 'custom-breakpoints-for-elementor' ),
     191                'updating'                        => __( 'Updating Plugin: %s', 'custom-breakpoints-for-elementor' ),
     192                'oops'                            => __( 'Something went wrong with the plugin API.', 'custom-breakpoints-for-elementor' ),
     193                'notice_can_install_required'     => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'custom-breakpoints-for-elementor' ),
     194                'notice_can_install_recommended'  => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'custom-breakpoints-for-elementor' ),
     195                'notice_ask_to_update'            => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'custom-breakpoints-for-elementor' ),
     196                'notice_ask_to_update_maybe'      => _n_noop( 'There is an update available for: %1$s.', 'There are updates available for the following plugins: %1$s.', 'custom-breakpoints-for-elementor' ),
     197                'notice_can_activate_required'    => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'custom-breakpoints-for-elementor' ),
     198                'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'custom-breakpoints-for-elementor' ),
     199                'install_link'                    => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'custom-breakpoints-for-elementor' ),
     200                'update_link'                     => _n_noop( 'Begin updating plugin', 'Begin updating plugins', 'custom-breakpoints-for-elementor' ),
     201                'activate_link'                   => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'custom-breakpoints-for-elementor' ),
     202                'return'                          => __( 'Return to Required Plugins Installer', 'custom-breakpoints-for-elementor' ),
     203                'plugin_activated'                => __( 'Plugin activated successfully.', 'custom-breakpoints-for-elementor' ),
     204                'activated_successfully'          => __( 'The following plugin was activated successfully:', 'custom-breakpoints-for-elementor' ),
     205                'plugin_already_active'           => __( 'No action taken. Plugin %1$s was already active.', 'custom-breakpoints-for-elementor' ),
     206                'plugin_needs_higher_version'     => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'custom-breakpoints-for-elementor' ),
     207                'complete'                        => __( 'All plugins installed and activated successfully. %1$s', 'custom-breakpoints-for-elementor' ),
     208                'dismiss'                         => __( 'Dismiss this notice', 'custom-breakpoints-for-elementor' ),
     209                'notice_cannot_install_activate'  => __( 'There are one or more required or recommended plugins to install, update or activate.', 'custom-breakpoints-for-elementor' ),
     210                'contact_admin'                   => __( 'Please contact the administrator of this site for help.', 'custom-breakpoints-for-elementor' ),
     211                'nag_type'                        => '',
    523212            ),
    524            
    525213        );
    526 
    527214        tgmpa( $plugins, $config );
    528215    }
    529216
    530     public function hooks_scripts( $hook ) {
    531 
    532         if ( 'master-addons_page_master-custom-breakpoints' != $hook ) return;
    533 
    534         wp_register_script( 'jltma-vue-js', JLTMA_MCB_PLUGIN_URL . 'assets/js/vue.js', [], JLTMA_MCB_VERSION, true );
    535 
    536         wp_register_script( 'jltma-hooks-js', JLTMA_MCB_PLUGIN_URL . 'assets/js/hooks.js', ['jltma-vue-js', 'jquery'], JLTMA_MCB_VERSION, true );
    537 
     217    /**
     218     * Check if Elementor is active and loaded
     219     *
     220     * @return bool
     221     */
     222    public function is_elementor_active() {
     223        if ( !function_exists( 'is_plugin_active' ) ) {
     224            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     225        }
     226        return is_plugin_active( 'elementor/elementor.php' ) && did_action( 'elementor/loaded' ) && class_exists( '\\Elementor\\Plugin' );
     227    }
     228
     229    public function hooks_scripts() {
     230        // Check for the correct screen ID
     231        $screen = get_current_screen();
     232        // Only run on our plugin's admin page
     233        if ( $screen->id !== 'toplevel_page_custom-breakpoints-for-elementor' && $screen->id !== 'master-addons_page_custom-breakpoints-for-elementor' ) {
     234            return;
     235        }
     236        // Check if Elementor is active before proceeding
     237        if ( !$this->is_elementor_active() ) {
     238            return;
     239        }
     240        wp_enqueue_style( 'master-cbp-admin', JLTMA_MCB_PLUGIN_URL . 'assets/css/master-cbp-admin.css' );
     241        // Enqueue React admin script with wp-element dependency
     242        wp_enqueue_script(
     243            'jltma-breakpoints-admin',
     244            JLTMA_MCB_PLUGIN_URL . 'assets/js/breakpoints-admin.js',
     245            ['wp-element', 'jquery'],
     246            JLTMA_MCB_VERSION,
     247            true
     248        );
    538249        $breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints();
    539 
    540         $breakpoints = array_map( function( $breakpoint ) {
     250        $breakpoints = array_map( function ( $breakpoint ) {
    541251            return [
    542252                'name' => $breakpoint->get_label(),
    543                 'key' => $breakpoint->get_name(),
    544                 'max' => $breakpoint->get_default_value()
     253                'key'  => $breakpoint->get_name(),
     254                'max'  => $breakpoint->get_default_value(),
    545255            ];
    546256        }, $breakpoints );
    547 
    548         $default_breakpoints = array_keys(Plugin::$instance->breakpoints->get_default_config());
    549 
     257        $default_breakpoints = array_keys( Plugin::$instance->breakpoints->get_default_config() );
     258        $upgrade_url = jltma_cbfe()->get_upgrade_url();
    550259        $data = [
    551             'breakpoints' => array_values( $breakpoints ),
     260            'breakpoints'     => array_values( $breakpoints ),
    552261            'default_devices' => $default_breakpoints,
    553             'devices' => [],
    554             'is_pro' => wp_validate_boolean( function_exists( 'ma_el_fs' ) && ma_el_fs()->can_use_premium_code() )
     262            'ajaxurl'         => admin_url( 'admin-ajax.php' ),
     263            'upgrade_url'     => $upgrade_url,
     264            'reset_nonce'     => wp_create_nonce( "breakpoints_reset" ),
    555265        ];
    556 
    557         wp_localize_script( 'jltma-hooks-js', 'jltma_custom_bp_data', $data );
    558 
    559         wp_enqueue_script( 'jltma-hooks-js' );
    560 
     266        wp_localize_script( 'jltma-breakpoints-admin', 'jltma_custom_bp_data', $data );
    561267    }
    562268
  • custom-breakpoints-for-elementor/trunk/lib/misc.php

    r2704815 r3417088  
    1313
    1414    public function __construct() {
    15        
     15
    1616        add_action( 'elementor/editor/wp_head', [$this, 'print_custom_scripts'] );
    1717
    1818        add_action( 'init', [$this, 'update_jltma_mcb_breakpoints'], 0 );
    1919
     20        // Swap Elementor's editor-app-bar.js with our patched version that includes icon fallbacks
     21        add_filter( 'script_loader_src', [$this, 'swap_editor_appbar_src'], 10, 2 );
     22
     23    }
     24
     25    /**
     26     * Swap Elementor's editor-app-bar.js with our patched version
     27     * The patched version includes width-based icon fallbacks for custom breakpoints
     28     */
     29    public function swap_editor_appbar_src( $src, $handle ) {
     30        if ( $handle === 'elementor-v2-editor-app-bar' ) {
     31            return JLTMA_MCB_PLUGIN_URL . 'assets/js/editor-app-bar.min.js?ver=' . JLTMA_MCB_VERSION;
     32        }
     33        return $src;
    2034    }
    2135
  • custom-breakpoints-for-elementor/trunk/readme.txt

    r2704815 r3417088  
    33Tags: custom breakpoints,responsive, breakpoints, elementor, elementor breakpoints, elementor plugin, elementor addon, elementor responsive
    44Requires at least: 4.0
    5 Tested up to: 5.9.2
    6 Requires PHP: 5.6
     5Tested up to: 6.9
     6Requires PHP: 7.0
    77Stable tag: trunk
    88License: GPLv3 or later
     
    1515== Description ==
    1616
    17 [Custom Breakpoints for Elementor](https://master-addons.com/demos/custom-breakpoints/) assist you to target any kind of Devices like Mobile, Tablet, Laptop, Desktop responsive value to design your pages for those devices.
     17[Custom Breakpoints for Elementor](https://master-addons.com/custom-breakpoints/) assist you to target any kind of Devices like Mobile, Tablet, Laptop, Desktop responsive value to design your pages for those devices.
    1818
    1919
    2020> 17+ default breakpoints
    2121> Works Exact same as Elementors Breakpoints
    22 > No Breakpoints Limits (Unlitimited)
    23 > Drag & Drop Sorting Breakpoints
    24 > Export Option
    25 > Import Option
    26 > Reset Option
     22> No Breakpoints Limits (Pro Version)
     23> Set max-width for automatic sorting Breakpoint positions
     24> Export Breakpoints Option
     25> Import Breakpoints Option
     26> Reset Breakpoints Option
    2727> Multisite Supports
    2828
    29 Elementor Breakpoints will help you to create a responsive website perfectly fit to any device. By default, there are three breakpoints in Elementor. But it's not enough when you try to target devices with their specific min - max width. 
     29Elementor Breakpoints will help you to create a responsive website perfectly fit to any device. By default, there are three breakpoints in Elementor. But it's not enough when you try to target devices with their specific min - max width.
    3030
    3131> ## [Master Addons for Elementor](https://wordpress.org/plugins/master-addons/)
     
    3333>[All Addons](https://master-addons.com/all-widgets/) | [Support](https://master-addons.com/contact-us/) | [Docs](https://master-addons.com/docs/) | [Tutorials](https://www.youtube.com/watch?v=vWGWzuRKIss) | [Upgrade Pro](http://bit.ly/32n5dXS)
    3434
    35 This Custom Breakpoint plugin will help you to set a specific property of elements for your custom made breakpoint. Just install and activate the plugin and you able to see a new option inside elementor called "Breakpoints". 
     35This Custom Breakpoint plugin will help you to set a specific property of elements for your custom made breakpoint. Just install and activate the plugin and you able to see a new option inside elementor called "Breakpoints".
    3636
    37 Set your desired device value in the breakpoint and arrange pages properly. 
     37Set your desired device value in the breakpoint and arrange pages properly.
    3838
    3939== Elementor Custom Breakpoints ==
     
    9090
    9191= How to add a Custom Breakpoint? =
    92 Navigate to the breakpoint option. You will see default breakpoint there. Just customize the default breakpoint with your own value and property. You can add new breakpoint too. 
     92Navigate to the breakpoint option. You will see default breakpoint there. Just customize the default breakpoint with your own value and property. You can add new breakpoint too.
    9393
    9494= Is it compatible with any Theme? =
     
    101101== Screenshots ==
    1021021. Custom Breakpoints for Elementor
    103 2. Custom Breakpoint editor 
     1032. Custom Breakpoint editor
    104104
    105105
     
    110110Paste on your Local Computer
    1111113. Activate the "Custom Breakpoints for Elementor" Plugin through the 'Plugins' menu in WordPress
    112 
    113 
    114 
    115 == Changelog ==
    116 = 2.0.2 (5-04-2022)=
    117 * Updated: Fully re-coded with Latest Elementor Free and Elementor Pro Support
    118 
    119 
    120 = 1.0.6 (09-07-2021)=
    121 * Updated: Fully re-coded with latest Elementor Free and Elementor Pro Support
    122 
    123 = 1.0.6 (15-09-2020)=
    124 * Updated: Overlapping Devices popup to center. Will fit perfectly to any screen size. Now, it will not overlap with header and footer panels.
    125 * Added: Device Name added on popup tooltip
    126 * Fixed: elementorFrontend 'undefined' on console error
    127 * Added: Device rotation Portrait/Landscape version added
    128 * Support: Latest Elementor 3.0.10 version compatible and Elementor Pro compatibility
    129 
    130 
    131 = 1.0.6 (15-09-2020)=
    132 * Updated: Settings data saved Database now, for better performance
    133 * Updated: Reset Option Updated
    134 * Updated: Export Option Updated
    135 * Updated: Import Option Updated
    136 * Fixed: other related tweaks
    137 
    138 = 1.0.5 (13-09-2020)=
    139 * Fixed: TGM class conclict issue fixed
    140 * Fixed: TGM class conclict array $plugins issue fixed
    141 
    142 = 1.0.4 (04-09-2020)=
    143 * Fixed: Native Breakpoints support for Sections, Columns and all Elements
    144 * Added: Added feature to Import/Export Section/Template will also work
    145 * Fixed: Typography and other issues not working issue fixed
    146 * Updated: Given support for Elementor 2.x.x and v3.x.x, now it works seamlessly with any version
    147 
    148 
    149 = 1.0.3 (26-08-2020)=
    150 * Updated: Required plugins junk code removed and fixed with TGM.
    151 
    152 = 1.0.2 (26-08-2020)=
    153 * Initial Release
    154 
Note: See TracChangeset for help on using the changeset viewer.