Plugin Directory

Changeset 3182110


Ignore:
Timestamp:
11/05/2024 08:51:45 AM (17 months ago)
Author:
solacewp
Message:

updated version 1.1.9

Location:
solace-extra
Files:
183 added
7 edited

Legend:

Unmodified
Added
Removed
  • solace-extra/trunk/README.txt

    r3174137 r3182110  
    55Requires at least: 6.2
    66Tested up to: 6.6
    7 Stable tag: 1.1.8
     7Stable tag: 1.1.9
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    2121- SolaceWP: [Terms of Use](https://solacewp.com/api/terms-of-service/), [Privacy Policy](https://solacewp.com/api/privacy-policy/)
    2222- Google reCAPTCHA: [Terms of Use](https://www.google.com/recaptcha/intro/v3.html), [Privacy Policy](https://policies.google.com/privacy)
     23- Sendy API: [Terms of Use](https://sendy.co/end-user-license-agreement), [Privacy Policy](https://sendy.co/privacy-policy)
    2324
    2425== Installation ==
     
    5758- This plugin provides additional functionality for the Solace theme. To view the uncompressed source code of the JavaScript used, please visit the following link: https://github.com/LottieFiles/lottie-player/tree/master/src and
    5859https://www.google.com/recaptcha/api.js
     60- This plugin uses the Sendy API for managing newsletter subscriptions. The data sent includes user email addresses and optional names during the subscription process. For more information, please refer to their [Terms of Use](https://sendy.co/end-user-license-agreement), [Privacy Policy](https://sendy.co/privacy-policy)
    5961
    6062== Screenshots ==
  • solace-extra/trunk/admin/class-solace-extra-admin.php

    r3168128 r3182110  
    174174        // Initialize the WP_Filesystem
    175175        if ( ! function_exists( 'WP_Filesystem' ) ) {
    176             require_once ABSPATH . 'wp-admin/includes/file.php';
     176            return;
    177177        }
    178178
  • solace-extra/trunk/admin/import.php

    r3174137 r3182110  
    6565
    6666    /**
    67      * Taken from the core media_sideload_image function and
    68      * modified to return an array of data instead of html.
    69      *
    70      * @since 0.1
    71      * @access private
    72      * @param string $file The image file path.
    73      * @return array An array of image data.
    74      */
    75     static private function _sideload_image($file)
    76     {
    77         $data = new stdClass();
    78 
    79         if (!function_exists('media_handle_sideload')) {
    80             require_once(ABSPATH . 'wp-admin/includes/media.php');
    81             require_once(ABSPATH . 'wp-admin/includes/file.php');
    82             require_once(ABSPATH . 'wp-admin/includes/image.php');
    83         }
    84         if (!empty($file)) {
    85 
    86             // Set variables for storage, fix file filename for query strings.
    87             preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
    88             $file_array = array();
    89             $file_array['name'] = basename($matches[0]);
    90 
    91             // Download file to temp location.
    92             $file_array['tmp_name'] = download_url($file);
    93 
    94             // If error storing temporarily, return the error.
    95             if (is_wp_error($file_array['tmp_name'])) {
    96                 return $file_array['tmp_name'];
    97             }
    98 
    99             // Do the validation and storage stuff.
    100             $id = media_handle_sideload($file_array, 0);
    101 
    102             // If error storing permanently, wp_delete_file.
    103             if (is_wp_error($id)) {
    104                 wp_delete_file($file_array['tmp_name']);
    105                 return $id;
    106             }
    107 
    108             // Build the object to return.
    109             $meta                    = wp_get_attachment_metadata($id);
    110             $data->attachment_id    = $id;
    111             $data->url                = wp_get_attachment_url($id);
    112             $data->thumbnail_url    = wp_get_attachment_thumb_url($id);
    113             $data->height            = $meta['height'];
    114             $data->width            = $meta['width'];
    115         }
    116 
    117         return $data;
    118     }
    119 
    120     /**
    12167     * Checks to see whether a string is an image url or not.
    12268     *
     
    13985
    14086    /**
    141      * Imports images for settings saved as mods.
    142      *
    143      * @since 0.1
    144      * @access private
    145      * @param array $mods An array of customizer mods.
    146      * @return array The mods array with any new import data.
    147      */
    148     static private function _import_images($mods)
    149     {
    150         foreach ($mods as $key => $val) {
    151 
    152             if (self::_is_image_url($val)) {
    153 
    154                 $data = self::_sideload_image($val);
    155 
    156                 if (!is_wp_error($data)) {
    157 
    158                     $mods[$key] = $data->url;
    159 
    160                     // Handle header image controls.
    161                     if (isset($mods[$key . '_data'])) {
    162                         $mods[$key . '_data'] = $data;
    163                         update_post_meta($data->attachment_id, '_wp_attachment_is_custom_header', get_stylesheet());
    164                     }
    165                 }
    166             }
    167         }
    168 
    169         return $mods;
    170     }
    171 
    172     /**
    17387     * Solace Ajax Import
    17488     */
     
    224138            wp_die();
    225139        }
    226 
    227         // Import images.
    228         // $data = Solace_Extra_Admin::_import_images( $data );
    229140
    230141        // If wp_css is set then import it.
     
    17971708    function install_and_activate_plugins()
    17981709    {
    1799         // Verify nonce
    1800         if (!isset($_POST['nonce']) || !wp_verify_nonce( sanitize_text_field( wp_unslash ( $_POST['nonce'] ) ), 'ajax-nonce' )) {
    1801             $response = array('error' => 'Invalid nonce!');
    1802             echo wp_json_encode($response);
    1803             wp_die();
    1804         }         
     1710        // Verify user permissions and nonce
     1711        if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'ajax-nonce' ) ) {
     1712            wp_send_json_error( [ 'error' => 'Invalid nonce!' ] );
     1713        }
     1714        if ( ! current_user_can( 'install_plugins' ) ) {
     1715            wp_send_json_error( [ 'error' => 'Unauthorized action!' ] );
     1716        }
    18051717
    18061718        update_option( 'elementor_onboarded', true );
     
    18131725        // Make remote request using wp_remote_get
    18141726        $response = wp_remote_get($url);
    1815 
    1816         // Decode the response body
    1817         $body = wp_remote_retrieve_body($response);
    1818         $decoded_data = json_decode($body, true);
    1819 
     1727        if ( is_wp_error( $response ) ) {
     1728            wp_send_json_error( [ 'error' => 'Failed to fetch plugins data.' ] );
     1729        }
     1730
     1731        $decoded_data = json_decode( wp_remote_retrieve_body( $response ), true );
    18201732        $plugins_to_install = null;
    18211733        if ( $decoded_data['page_builder'] && $decoded_data['ecommerce'] ) {
     
    18341746        }
    18351747
    1836         foreach ($plugins_to_install as $plugin_slug) {
    1837             if (!is_plugin_active($plugin_slug . '/' . $plugin_slug . '.php')) {
    1838 
    1839                 if (!file_exists(WP_PLUGIN_DIR . '/' . $plugin_slug . '/' . $plugin_slug . '.php')) {
    1840 
    1841                     include_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
    1842                     $api = plugins_api('plugin_information', array('slug' => $plugin_slug));
    1843                     if (isset($api->download_link)) {
    1844                         $plugin_zip = download_url($api->download_link);
    1845                         if (!is_wp_error($plugin_zip)) {
    1846                             $plugin_dir = trailingslashit(WP_PLUGIN_DIR);
    1847                             $zip = new ZipArchive;
    1848                             if ($zip->open($plugin_zip) === true) {
    1849                                 $zip->extractTo($plugin_dir);
    1850                                 $zip->close();
    1851                                 wp_delete_file($plugin_zip);
    1852                             }
     1748        if ( ! function_exists( 'plugins_api' ) ) {
     1749            require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
     1750        }
     1751        if ( ! class_exists( 'WP_Upgrader' ) ) {
     1752            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     1753        }
     1754
     1755        foreach ( $plugins_to_install as $plugin_slug ) {
     1756            if ( ! is_plugin_active( "$plugin_slug/$plugin_slug.php" ) && ! file_exists( WP_PLUGIN_DIR . "/$plugin_slug/$plugin_slug.php" ) ) {
     1757                $api = plugins_api( 'plugin_information', [ 'slug' => $plugin_slug ] );
     1758                if ( isset( $api->download_link ) ) {
     1759                    $plugin_zip = download_url( $api->download_link );
     1760                    if ( ! is_wp_error( $plugin_zip ) ) {
     1761                        $zip = new ZipArchive;
     1762                        if ( $zip->open( $plugin_zip ) === true ) {
     1763                            $zip->extractTo( WP_PLUGIN_DIR );
     1764                            $zip->close();
     1765                            wp_delete_file( $plugin_zip );
    18531766                        }
    18541767                    }
     
    18571770        }
    18581771
    1859         foreach ($plugins_to_install as $plugin_slug) {
    1860             activate_plugin($plugin_slug . '/' . $plugin_slug . '.php');
    1861         }
    1862 
    1863         esc_html_e('Plugin Installed and Activated', 'solace-extra');
    1864 
    1865         // Set permalink structure to 'Post name'
    1866         $permalink_structure = '/%postname%/';
    1867 
    1868         // Update permalink structure
    1869         update_option('permalink_structure', $permalink_structure);
    1870 
    1871         // Flush rewrite rules to ensure the changes take effect
    1872         flush_rewrite_rules();       
    1873 
    1874         $url = admin_url( 'options-permalink.php' );
    1875        
    1876         $response = wp_remote_get( $url );       
    1877 
    1878         // Flush rewrite rules to ensure the changes take effect
     1772        foreach ( $plugins_to_install as $plugin_slug ) {
     1773            activate_plugin( "$plugin_slug/$plugin_slug.php" );
     1774        }
     1775
     1776        update_option( 'permalink_structure', '/%postname%/' );
    18791777        flush_rewrite_rules();         
    18801778
     
    18871785        } else {
    18881786            esc_html_e( 'Onboarding False', 'solace-extra');
    1889         }       
     1787        }   
    18901788    }
    18911789
     
    22912189        }
    22922190
     2191        // Set Shop page.
     2192        update_option( 'woocommerce_shop_page_id', null );       
     2193
    22932194        // Loop through each menu
    22942195        if (!empty($menus)) {
     
    24612362                        $page_for_posts = $post_exists;
    24622363                        update_option( 'page_for_posts', $page_for_posts );
     2364                    }
     2365
     2366                    if ( $menu_item->is_shop_page && $menu_item->woocommerce_shop_page_id ) {
     2367                        // Set Shop page.
     2368                        update_option( 'woocommerce_shop_page_id', $post_exists );
    24632369                    }
    24642370
  • solace-extra/trunk/admin/partials/submenu-dashboardcongratulations.php

    r3121792 r3182110  
    66    exit;
    77}
     8
     9// Flush rewrite rules to ensure the changes take effect
     10flush_rewrite_rules();
    811
    912$customizer_link = admin_url('customize.php');
  • solace-extra/trunk/elementor/widgets/assets/form/form-builder.css

    r3174137 r3182110  
    7373}
    7474
    75 @media only screen and (max-width: 576px) {
    76     .solaceform-fields,
    77     .efb-field-width-100,
    78     .efb-field-width-80,
    79     .efb-field-width-75,
    80     .efb-field-width-66,
    81     .efb-field-width-60,
    82     .efb-field-width-50,
    83     .efb-field-width-40,
    84     .efb-field-width-33,
    85     .efb-field-width-25,
    86     .efb-field-width-20 {
     75@media only screen and (max-width: 768px) {
     76    .efb-field-width-tablet-100 {
    8777        width: 100%;
    8878    }
     79
     80    .efb-field-width-tablet-80 {
     81        width: 80%;
     82    }
     83
     84    .efb-field-width-tablet-75 {
     85        width: 75%;
     86    }
     87
     88    .efb-field-width-tablet-66 {
     89        width: 66%;
     90    }
     91
     92    .efb-field-width-tablet-60 {
     93        width: 60%;
     94    }
     95
     96    .efb-field-width-tablet-50 {
     97        width: 50%;
     98    }
     99
     100    .efb-field-width-tablet-40 {
     101        width: 40%;
     102    }
     103
     104    .efb-field-width-tablet-33 {
     105        width: 33%;
     106    }
     107
     108    .efb-field-width-tablet-25 {
     109        width: 25%;
     110    }
     111
     112    .efb-field-width-tablet-20 {
     113        width: 20%;
     114    }
    89115}
     116
     117@media only screen and (max-width: 568px) {
     118    .efb-field-width-mobile-100 {
     119        width: 100%;
     120    }
     121
     122    .efb-field-width-mobile-80 {
     123        width: 80%;
     124    }
     125
     126    .efb-field-width-mobile-75 {
     127        width: 75%;
     128    }
     129
     130    .efb-field-width-mobile-66 {
     131        width: 66%;
     132    }
     133
     134    .efb-field-width-mobile-60 {
     135        width: 60%;
     136    }
     137
     138    .efb-field-width-mobile-50 {
     139        width: 50%;
     140    }
     141
     142    .efb-field-width-mobile-40 {
     143        width: 40%;
     144    }
     145
     146    .efb-field-width-mobile-33 {
     147        width: 33%;
     148    }
     149
     150    .efb-field-width-mobile-25 {
     151        width: 25%;
     152    }
     153
     154    .efb-field-width-mobile-20 {
     155        width: 20%;
     156    }
     157}
  • solace-extra/trunk/elementor/widgets/widget/form-builder.php

    r3168128 r3182110  
    886886        if ( $fields ) {
    887887            foreach ( $fields as $field ) {
    888                 $width  = $field['field_width'] ? $field['field_width'] : '';
     888
     889                $width  = isset( $field['field_width'] ) ? $field['field_width'] : '';
     890                $width_tablet  = isset( $field['field_width_tablet'] ) ? $field['field_width_tablet'] : '';
     891                $width_mobile  = isset( $field['field_width_mobile'] ) ? $field['field_width_mobile'] : '';
     892
    889893                $params = array(
    890894                    'type'           => $field['field_type'] ? strtolower( $field['field_type'] ) : '',
     
    893897                    'value'          => $field['field_default_value'] ? $field['field_default_value'] : '',
    894898                    'name'           => $field['field_name'] ? $field['field_name'] : '',
    895                     'width'          => $field['field_width'] ? $field['field_width'] : '',
     899                    'width'          => isset( $field['field_width'] ) ? $field['field_width'] : '',
     900                    'width_tablet'   => isset( $field['field_width_tablet'] ) ? $field['field_width_tablet'] : '',
     901                    'width_mobile' => isset( $field['field_width_mobile'] ) ? $field['field_width_mobile'] : '',
    896902                    'required'       => $field['field_required'] ? $field['field_required'] : '',
    897903                    'id'             => $field['field_id'] ? $field['field_id'] : '',
     
    906912                );
    907913
    908                 echo '<div class="solaceform-fields elementor-repeater-item-' . esc_attr( $field['_id'] ) . ' efb-field-width-' . esc_attr( $width ) . '">';
     914                echo '<div class="solaceform-fields elementor-repeater-item-' . esc_attr( $field['_id'] ) . ' efb-field-width-' . esc_attr( $width ) . ' efb-field-width-tablet-' . esc_attr( $width_tablet) . ' efb-field-width-mobile-' . esc_attr( $width_mobile) .'">';
    909915
    910916                switch ( $field['field_type'] ) {
  • solace-extra/trunk/solace-extra.php

    r3174137 r3182110  
    1313 *
    1414 * Plugin Name:       Solace Extra
    15  * Plugin URI:        https://solacewp.com/solace-extra
     15 * Plugin URI:        https://solacewp.com/
    1616 * Description:       Additional features for Solace Theme
    17  * Version:           1.1.8
     17 * Version:           1.1.9
    1818 * Requires PHP:      7.4
    1919 * Author:            Solace
     
    151151add_action('wp_ajax_nopriv_solace_extra_upload_logo', 'solace_extra_upload_logo'); 
    152152
    153 function solace_extra_install_plugin_from_url($plugin_url) {
    154     include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    155     include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    156     include_once ABSPATH . 'wp-admin/includes/plugin.php';
    157     include_once ABSPATH . 'wp-admin/includes/file.php';
    158 
    159     $temporary_file = download_url($plugin_url);
    160 
    161     if (is_wp_error($temporary_file)) {
    162         echo esc_html( 'Error: ' . $temporary_file->get_error_message() );
    163         return;
    164     }
    165 
    166     $plugin_upgrader = new Plugin_Upgrader();
    167     $installation = $plugin_upgrader->install($temporary_file);
    168 
    169     wp_delete_file($temporary_file);
    170 
    171     if (is_wp_error($installation)) {
    172         echo esc_html( 'Installation failed: ' . $temporary_file->get_error_message() );
    173     } else {
    174         esc_html_e( 'Installation successful!', 'solace-extra' );
    175     }
    176 }
    177 
    178 
    179 // solace_extra_install_plugin_from_url('http://solacewp.com/download/solace-extra.zip');
    180 
    181 function solace_extra_install_plugin_from_wp_repo($plugin_slug) {
    182     include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    183     include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
    184 
    185     $api = plugins_api('plugin_information', array('slug' => $plugin_slug, 'fields' => array('sections' => false)));
    186     if (is_wp_error($api)) {
    187         echo esc_html( 'Error: ' . $api->get_error_message() );
    188         return;
    189     }
    190 
    191     $upgrader = new Plugin_Upgrader();
    192     $result = $upgrader->install($api->download_link);
    193 
    194     if (is_wp_error($result)) {
    195         echo esc_html( 'Installation failed: ' . $result->get_error_message() );
    196     } else {
    197         esc_html_e( 'Installation successful!', 'solace-extra' );
    198     }
    199 }
    200 
    201 // solace_extra_install_plugin_from_wp_repo('elementor');
    202 
    203153if ( ! function_exists( 'solace_is_run_in_shortcode' ) ) {
    204154
Note: See TracChangeset for help on using the changeset viewer.