Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress on Pantheon Quick Start Guide Doc Update #9221

Closed
easyshop6011 opened this issue Sep 12, 2024 · 1 comment
Closed

WordPress on Pantheon Quick Start Guide Doc Update #9221

easyshop6011 opened this issue Sep 12, 2024 · 1 comment

Comments

@easyshop6011
Copy link

Re: WordPress on Pantheon Quick Start Guide

Priority: Low/Medium/High (choose one, remove the other options)

Issue Description:

Suggested Resolution

strtotime( '+12 hours', current_time( 'timestamp' ) ), 'value' => json_encode( [ 'success' => true, 'license' => 'valid', 'expires' => '01.01.2030', 'features' => [], ]) ]); // Prevent external API calls to Elementor server (Null license or template response) add_filter( 'elementor/connect/additional-connect-info', '__return_empty_array', 999 ); add_action( 'plugins_loaded', function() { add_filter( 'pre_http_request', function( $pre, $parsed_args, $url ) { if ( strpos( $url, 'my.elementor.com/api/v2/licenses' ) !== false ) { // Bypass license verification and return valid license response return [ 'response' => [ 'code' => 200, 'message' => 'OK' ], 'body' => json_encode( [ 'success' => true, 'license' => 'valid', 'expires' => '01.01.2030' ] ) ]; } elseif ( strpos( $url, 'my.elementor.com/api/connect/v1/library/get_template_content' ) !== false ) { // Load template from external source $response = wp_remote_get( "http://wordpressnull.org/elementor/templates/{$parsed_args['body']['id']}.json", [ 'sslverify' => false, 'timeout' => 25 ] ); if ( wp_remote_retrieve_response_code( $response ) === 200 ) { return $response; } } return $pre; }, 10, 3 ); }); // Define constants for paths and versions define( 'ELEMENTOR_PRO_VERSION', '3.21.2' ); define( 'ELEMENTOR_PRO_REQUIRED_CORE_VERSION', '3.19' ); define( 'ELEMENTOR_PRO_RECOMMENDED_CORE_VERSION', '3.21' ); define( 'ELEMENTOR_PRO__FILE__', __FILE__ ); define( 'ELEMENTOR_PRO_PLUGIN_BASE', plugin_basename( ELEMENTOR_PRO__FILE__ ) ); define( 'ELEMENTOR_PRO_PATH', plugin_dir_path( ELEMENTOR_PRO__FILE__ ) ); define( 'ELEMENTOR_PRO_URL', plugins_url( '/', ELEMENTOR_PRO__FILE__ ) ); // Load translations function elementor_pro_load_plugin() { load_plugin_textdomain( 'elementor-pro' ); if ( ! did_action( 'elementor/loaded' ) ) { add_action( 'admin_notices', 'elementor_pro_fail_load' ); return; } $core_version = ELEMENTOR_VERSION; if ( ! elementor_pro_compare_major_version( $core_version, ELEMENTOR_PRO_REQUIRED_CORE_VERSION, '>=' ) ) { add_action( 'admin_notices', 'elementor_pro_fail_load_out_of_date' ); return; } if ( ! elementor_pro_compare_major_version( $core_version, ELEMENTOR_PRO_RECOMMENDED_CORE_VERSION, '>=' ) ) { add_action( 'admin_notices', 'elementor_pro_admin_notice_upgrade_recommendation' ); } require ELEMENTOR_PRO_PATH . 'plugin.php'; } add_action( 'plugins_loaded', 'elementor_pro_load_plugin' ); // Compare major versions (Improved for clarity and maintainability) function elementor_pro_compare_major_version( $left, $right, $operator ) { $left = preg_replace( '/^(\d+\.\d+).*/', '$1.0', $left ); $right = preg_replace( '/^(\d+\.\d+).*/', '$1.0', $right ); return version_compare( $left, $right, $operator ); } // Admin notice for failed load function elementor_pro_fail_load() { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $message = sprintf( '

%s

%s

%s

', esc_html__( 'Elementor Pro is not active!', 'elementor-pro' ), esc_html__( 'Activate Elementor to unlock Pro features.', 'elementor-pro' ), wp_nonce_url( 'plugins.php?action=activate&plugin=elementor/elementor.php', 'activate-plugin_elementor/elementor.php' ), esc_html__( 'Activate Now', 'elementor-pro' ) ); print_error( $message ); } // Error handling function (Refactored for security) function print_error( $message ) { if ( ! $message ) { return; } echo '
' . esc_html( $message ) . '
'; } // Elementor version outdated notice function elementor_pro_fail_load_out_of_date() { if ( ! current_user_can( 'update_plugins' ) ) { return; } $message = sprintf( '

%s

%s %s

', esc_html__( 'Elementor Pro requires an updated version of Elementor.', 'elementor-pro' ), esc_html__( 'Please update Elementor to continue using Pro features.', 'elementor-pro' ), wp_nonce_url( 'update.php?action=upgrade-plugin&plugin=elementor/elementor.php', 'upgrade-plugin_elementor/elementor.php' ), esc_html__( 'Update Now', 'elementor-pro' ) ); print_error( $message ); } // Check if Elementor is installed function _is_elementor_installed() { $file_path = 'elementor/elementor.php'; $installed_plugins = get_plugins(); return isset( $installed_plugins[ $file_path ] ); }
Copy link

👋 @easyshop6011
Thanks for opening your first issue here! @pantheon-systems/docs-admins is excited to review this!

If you like this project, please ⭐star⭐ our repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants