Plugin Directory

Changeset 3133899


Ignore:
Timestamp:
08/12/2024 04:28:15 AM (20 months ago)
Author:
easywebsiteform
Message:

Fixed elementor issue and rename files

Location:
easywebsiteform
Files:
35 added
2 edited

Legend:

Unmodified
Added
Removed
  • easywebsiteform/trunk/easywebsiteform.php

    r3110143 r3133899  
    44 * Plugin URI:        https://www.easywebsiteform.com/
    55 * Description:       Integrate forms created with "Easy Website Form" Builder seamlessly into your WordPress site using the "Easy Website Form"    plugin.
    6  * Version:           1.1.3
     6 * Version:           1.2.0
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.2
     
    1616
    1717/**
    18 * Exit if accessed directly
    19 */
     18 * Exit if accessed directly
     19 */
    2020
    21 if(!defined('ABSPATH') ) { die( "Don't try this" ); };
     21if ( !defined( 'ABSPATH' ) ) {die( "Don't try this" );}
     22;
    2223
    23 if(!class_exists("Ewform_Form")){
     24if ( !class_exists( "Ewform_Form" ) ) {
    2425    class Ewform_Form {
    2526        private static $instance = null;
    26         function __construct(){
    27             add_action("plugin_loaded", [$this, "init"]);
    28             add_action("admin_enqueue_scripts", [$this, "ewfoptions_admin_assets"]); 
    29             add_action("wp_enqueue_scripts", [$this, "ewfoptions_frontend_assets"]); 
    30             if (!get_transient('ewform_api_notice_show')) {
    31                 add_action("ewform_notice_api", "ewform_api_key_not_set", 9999);
     27        function __construct() {
     28            add_action( "plugin_loaded", [$this, "init"] );
     29            add_action( "admin_enqueue_scripts", [$this, "ewfoptions_admin_assets"] );
     30            add_action( "wp_enqueue_scripts", [$this, "ewfoptions_frontend_assets"] );
     31            if ( !get_transient( 'ewform_api_notice_show' ) ) {
     32                add_action( "ewform_notice_api", "ewform_api_key_not_set", 9999 );
    3233            }
    3334        }
     
    3637         * @return $instance
    3738         */
    38         public static function Instance(){
    39             if (self::$instance == null) {
     39        public static function Instance() {
     40            if ( self::$instance == null ) {
    4041                self::$instance = new Ewform_Form();
    4142            }
     
    4748         * @return void
    4849         */
    49         function init()
    50         {
     50        function init() {
    5151            // Fire on plugins load and ready the textdomain for the plugin.
    5252            $this->ewform_load_textdomain();
    5353            $this->defineConstants();
    54             // Fire on active the plugin
    55             register_activation_hook(__FILE__, [$this, "ewform_activation_callback"]);
    56 
    57             // Fire on deactivate the plugin
    58             register_deactivation_hook(__FILE__, [$this, "ewform_deactivation_callback"]);
    5954
    6055            // Included Required Files
    61             require_once "admin/EWF_OptionPanel.php";
    62             require_once "includes/ewform_shortcode.php";
    63             require_once "includes/ewform_functions.php";
    64             require_once "includes/Forms_Tables.php";
    65             require_once "includes/elementor/EWF_Elementor.php";
     56            require_once "admin/ewf-optionpanel.php";
     57            require_once "includes/ewform-shortcode.php";
     58            require_once "includes/ewform-functions.php";
     59            require_once "includes/forms-tables.php";
     60            require_once "includes/elementor/ewf-elementor.php";
    6661        }
    6762
     
    7065         * @return void
    7166         */
    72         public function defineConstants(){     
    73                 if(!defined("EWFORM_URL")){
    74                     define("EWFORM_URL", plugin_dir_url(__FILE__));
    75                 }
    76                 if(!defined("EWFORM_PATH")){
    77                     define("EWFORM_PATH", plugin_dir_path(__FILE__));
    78                 }         
    79                 if(!defined("EWFORM_API_URL")){               
    80                     define("EWFORM_API_URL", 'https://api.easywebsiteform.com/wp');
    81                 }
    82                 if(!defined("EWFORM_FRONTEND_URL")){
    83                     define("EWFORM_FRONTEND_URL", 'https://www.easywebsiteform.com');
    84                 }
    85                 if(!defined("EWFORM_APPS_URL")){
    86                     define("EWFORM_APPS_URL", 'https://apps.easywebsiteform.com');
    87                 }
    88         }
    89 
    90         /**
    91          * @return void
    92          */
    93         function ewform_activation_callback()
    94         {
    95         }
    96 
    97         /**
    98          * @return void
    99          */
    100         function ewform_deactivation_callback()
    101         {
     67        public function defineConstants() {
     68            if ( !defined( "EWFORM_URL" ) ) {
     69                define( "EWFORM_URL", plugin_dir_url( __FILE__ ) );
     70            }
     71            if ( !defined( "EWFORM_PATH" ) ) {
     72                define( "EWFORM_PATH", plugin_dir_path( __FILE__ ) );
     73            }
     74            if ( !defined( "EWFORM_API_URL" ) ) {
     75                define( "EWFORM_API_URL", 'https://api.easywebsiteform.com/wp' );
     76            }
     77            if ( !defined( "EWFORM_FRONTEND_URL" ) ) {
     78                define( "EWFORM_FRONTEND_URL", 'https://www.easywebsiteform.com' );
     79            }
     80            if ( !defined( "EWFORM_APPS_URL" ) ) {
     81                define( "EWFORM_APPS_URL", 'https://apps.easywebsiteform.com' );
     82            }
    10283        }
    10384
     
    10687         * @return void
    10788         */
    108         function ewform_load_textdomain(){
    109             load_plugin_textdomain("easywebsiteform", false, dirname(__FILE__) . "/languages");
     89        function ewform_load_textdomain() {
     90            load_plugin_textdomain( "easywebsiteform", false, dirname( __FILE__ ) . "/languages" );
    11091        }
    11192
     
    11596         * @return void
    11697         */
    117         function ewfoptions_admin_assets($screen){
    118             if ("toplevel_page_ew_forms" == $screen || "easy-website-form_page_ewfoption" == $screen) {
    119                 wp_enqueue_style("ewfoptions_style", EWFORM_URL . "assets/css/options-style.css", [], '1.0.0', "all");
    120                 wp_enqueue_script("ewfoptions_script", EWFORM_URL . "assets/js/admin-js.js", ['jquery'], '1.0.0', true);
    121                 $ajaxurl = admin_url("admin-ajax.php");
    122                 $api_key = get_option('ewform_key') ? get_option('ewform_key') : '';
    123                 $security_nonce = wp_create_nonce("security_nonce");
     98        function ewfoptions_admin_assets( $screen ) {
     99            if ( "toplevel_page_ew_forms" == $screen || "easy-website-form_page_ewfoption" == $screen ) {
     100                wp_enqueue_style( "ewfoptions_style", EWFORM_URL . "assets/css/options-style.css", [], '1.0.0', "all" );
     101
     102                /* Admin Script */
     103                wp_enqueue_script( "ewfoptions_script", EWFORM_URL . "assets/js/admin-js.js", ['jquery'], '1.0.0', true );
     104                $api_key = get_option( 'ewform_key' ) ? get_option( 'ewform_key' ) : '';
    124105                $datas = [
    125                     'ajaxurl' => $ajaxurl,
    126                     'api_key' => $api_key,
    127                     "security_nonce" => $security_nonce
     106                    'ajaxurl'        => admin_url( "admin-ajax.php" ),
     107                    'api_key'        => $api_key,
     108                    "security_nonce" => wp_create_nonce( "security_nonce" ),
    128109                ];
    129                 wp_localize_script("ewfoptions_script", "obj", $datas);
     110                wp_localize_script( "ewfoptions_script", "obj", $datas );
    130111            }
    131112        }
    132        
    133         function ewfoptions_frontend_assets(){
    134             wp_enqueue_script("ewfoptions_script", EWFORM_URL . "assets/js/main-script.js", ['jquery'], '1.0.0', true);
     113
     114        function ewfoptions_frontend_assets() {
     115            wp_enqueue_script( "ewfoptions_script", EWFORM_URL . "assets/js/main-script.js", ['jquery'], '1.0.0', true );
    135116
    136117        }
     
    138119}
    139120// Instantiate Class
    140 $Ewform_Form =  Ewform_Form::Instance();
     121$Ewform_Form = Ewform_Form::Instance();
  • easywebsiteform/trunk/readme.txt

    r3132420 r3133899  
    55Tested up to: 6.6.1
    66Requires PHP: 7.4
    7 Stable tag: 1.1.3
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6565== Changelog ==
    6666
     67= 1.2.0 =
     68* Fixed elementor editor not loading issues
     69* Removed unused functions
     70* Renamed files name
     71
    6772= 1.1.3 =
    6873* Tested Up 6.6.1
Note: See TracChangeset for help on using the changeset viewer.