diff --git a/.travis.yml b/.travis.yml index 93979eb..99464c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,13 @@ language: php matrix: include: - # Arbitrary PHP version to run the sniffs against. + - php: '5.6' + - php: '7.0' - php: '7.1' + - php: '7.2' + - php: '7.3' + - php: '7.4' + - php: '8.0' before_install: - export PHPCS_DIR=/tmp/phpcs @@ -23,4 +28,4 @@ script: # for example: `--standard=wpcs.xml`. # You can use any of the normal PHPCS command line arguments in the command: # https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage - - $PHPCS_DIR/bin/phpcs -p . --standard=WordPress --extensions=php --runtime-set ignore_warnings_on_exit 1 \ No newline at end of file + - $PHPCS_DIR/bin/phpcs -ps . --standard=WordPress --extensions=php --runtime-set ignore_warnings_on_exit 1 diff --git a/css/admin-global.css b/css/admin-global.css index db509cc..d65b408 100644 --- a/css/admin-global.css +++ b/css/admin-global.css @@ -1,7 +1,52 @@ -#facebook-page-plugin-shortcode-generator p:after{clear:both;display:table;content:" ";} -#facebook-page-plugin-shortcode-generator input:not([type="checkbox"]),#facebook-page-plugin-shortcode-generator select{width:50%;} -#facebook-page-plugin-shortcode-generator input,#facebook-page-plugin-shortcode-generator select{float:right;} -#facebook-page-plugin-shortcode-generator #facebook-page-plugin-shortcode-generator-output{width:100%;float:none;} -.facebook-page-plugin-donate{margin:20px 0 10px;font-size:14px;line-height:175%;background:#fff;border: 1px solid rgba(0,0,0,0.1);border-left:4px solid #46b450;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 29px 1px 12px;position:relative;} -.facebook-page-plugin-donate p{margin:.5em 0;padding:2px;} -.facebook-page-plugin-donate .notice-dismiss{text-decoration:none;} \ No newline at end of file +.facebook-page-plugin-shortcode-generator p { + margin: .5em 0; + padding-bottom: .5em; + border-bottom: 1px solid rgba( 0, 0, 0, .1 ); +} + +.facebook-page-plugin-shortcode-generator p:after { + clear:both; + display:table; + content:""; +} + +.facebook-page-plugin-shortcode-generator input:not([type="checkbox"]), +.facebook-page-plugin-shortcode-generator select { + width:50%; +} + +.wp-admin .facebook-page-plugin-shortcode-generator p label input[type="checkbox"] { + margin-top: 4px; +} + +.facebook-page-plugin-shortcode-generator input, +.facebook-page-plugin-shortcode-generator select { + float:right; +} + +.facebook-page-plugin-shortcode-generator input.facebook-page-plugin-shortcode-generator-output { + width:100%; + float:none; +} + +.facebook-page-plugin-donate { + margin:20px 0 10px; + font-size:14px; + line-height:175%; + background:#fff; + border: 1px solid rgba(0,0,0,0.1); + border-left:4px solid #46b450; + -webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1); + box-shadow:0 1px 1px 0 rgba(0,0,0,.1); + padding:1px 29px 1px 12px; + position:relative; +} + +.facebook-page-plugin-donate p { + margin:.5em 0; + padding:2px; +} + +.facebook-page-plugin-donate .notice-dismiss { + text-decoration:none; +} diff --git a/css/admin-landing-page.css b/css/admin-landing-page.css index 46c9ddf..cefd536 100644 --- a/css/admin-landing-page.css +++ b/css/admin-landing-page.css @@ -1,123 +1,34 @@ -body.settings_page_mongoose-page-plugin { - background: #fff; -} - -.settings_page_mongoose-page-plugin .welcome-panel-content { - margin-right: 13px; -} - -.settings_page_mongoose-page-plugin .welcome-panel-image { - width: 100%; -} - -.settings_page_mongoose-page-plugin .about-description { - margin: 13px 0 0; -} - -.settings_page_mongoose-page-plugin .spinner.is-active { - float: none !important; - margin-left: 0 !important; -} - -.settings_page_mongoose-page-plugin #wpbody-content { - font-family: 'Muli', 'Helvetica', 'Arial', sans-serif; -} - .settings_page_mongoose-page-plugin .page-title { - font-family: 'Rammetto One', cursive; - padding: 0; + margin-bottom: 1rem; } -.settings_page_mongoose-page-plugin h2, -.settings_page_mongoose-page-plugin h3, -.settings_page_mongoose-page-plugin h4, -.settings_page_mongoose-page-plugin h5, -.settings_page_mongoose-page-plugin h6 { - font-family: 'Paytone One', sans-serif; -} - -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__box { - background-color: #f8f3ed; - padding: 20px 25px; - margin-bottom: 20px; - border: none; - box-shadow: none; +.settings_page_mongoose-page-plugin .page-title__icon { + width: 32px; + vertical-align: middle; + margin-right: .5rem; } -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__box p:last-child { - margin-bottom: 0 !important; -} - -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__box .inside { - margin-top: 0; - padding: 0; -} -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__box .inside h2 { - padding-top: 0; -} - -.settings_page_mongoose-page-plugin .notices-placeholder { - visibility: hidden; - height: 0; - overflow: hidden; +.settings_page_mongoose-page-plugin dt { + font-weight: bold; + font-size: 1rem; } -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin { - max-width: 1544px; +.settings_page_mongoose-page-plugin dt p { + font-weight: normal; } -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__banner { - position: relative; +.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__box { + max-width: 600px; } -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__banner:after { - position: absolute; - content: ""; - background-image: url( ../images/banner-border.png ); - background-size: contain; - bottom: 0; - left: 0; - width: 100%; - height: 100%; - background-position: center bottom; - background-repeat: no-repeat; +.settings_page_mongoose-page-plugin .tab-content { + display: none; } -.settings_page_mongoose-page-plugin .mongoose-facebook-page-plugin__banner img { - max-width: 100%; - height: auto; +.settings_page_mongoose-page-plugin .tab-content.active { display: block; } -.mongoose-facebook-page-plugin .button { - border: none; - background: #e46341; - box-shadow: none; - border-radius: 0; - color: #fff; - border: 2px solid #e46341; - padding: 4px 12px; - height: auto; - transition: .2s ease all; - font-family: 'Paytone One', sans-serif; -} - -.mongoose-facebook-page-plugin .button:hover, -.mongoose-facebook-page-plugin .button:focus { - background: transparent; - border: 2px solid #e46341; - color: #e46341; -} - -.settings_page_mongoose-page-plugin #mce-EMAIL { - padding: 4px 12px; - line-height: 28px; -} - -.settings_page_mongoose-page-plugin dt { - font-weight: bold; -} - -.settings_page_mongoose-page-plugin dt p { - font-weight: normal; +.settings_page_mongoose-page-plugin .facebook-page-plugin-shortcode-generator { + max-width: 500px; } diff --git a/facebook-page-feed-graph-api.php b/facebook-page-feed-graph-api.php index 93cef3d..fa1508f 100644 --- a/facebook-page-feed-graph-api.php +++ b/facebook-page-feed-graph-api.php @@ -3,7 +3,7 @@ * Plugin Name: Mongoose Page Plugin * Plugin URI: https://mongoosemarketplace.com/downloads/facebook-page-plugin/ * Description: The most popular way to display the Facebook Page Plugin on your WordPress website. Easy implementation using a shortcode or widget. Now available in 95 different languages - * Version: 1.8.3 + * Version: 1.9.0 * Author: Mongoose Marketplace * Author URI: https://mongoosemarketplace.com/ * License: GPLv2 @@ -13,7 +13,7 @@ */ /* -Copyright 2015-2019 Cameron Jones (email : support@mongoosemarketplace.com) +Copyright 2015-2022 Cameron Jones (email : support@mongoosemarketplace.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as diff --git a/images/banner-1544x500.png b/images/banner-1544x500.png deleted file mode 100644 index f3dae82..0000000 Binary files a/images/banner-1544x500.png and /dev/null differ diff --git a/images/banner-border.png b/images/banner-border.png deleted file mode 100644 index 92d0e4b..0000000 Binary files a/images/banner-border.png and /dev/null differ diff --git a/images/mongoose-page-plugin-icon.png b/images/mongoose-page-plugin-icon.png new file mode 100644 index 0000000..a8fcb04 Binary files /dev/null and b/images/mongoose-page-plugin-icon.png differ diff --git a/inc/class-mongoose-page-plugin-shortcode-generator.php b/inc/class-mongoose-page-plugin-shortcode-generator.php index a9b9696..3dfe3aa 100644 --- a/inc/class-mongoose-page-plugin-shortcode-generator.php +++ b/inc/class-mongoose-page-plugin-shortcode-generator.php @@ -32,16 +32,17 @@ public function __construct() { * Create the markup for the shortcode generator */ public function generate() { + wp_enqueue_script( 'facebook-page-plugin-admin-scripts' ); + $return = null; - $return .= Mongoose_Page_Plugin::get_instance()->donate_notice(); $return .= ''; - $return .= '
'; - echo $return; + echo $return; // phpcs:ignore WordPress.Security.EscapeOutput } } diff --git a/inc/class-mongoose-page-plugin.php b/inc/class-mongoose-page-plugin.php index 15390e5..5b3e15f 100644 --- a/inc/class-mongoose-page-plugin.php +++ b/inc/class-mongoose-page-plugin.php @@ -243,7 +243,6 @@ public function files() { */ public function hooks() { // Actions. - add_action( 'wp_dashboard_setup', array( $this, 'facebook_page_plugin_dashboard_widget' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'admin_resources' ) ); add_action( 'admin_init', array( $this, 'remove_donate_notice_nojs' ) ); add_action( 'admin_menu', array( $this, 'landing_page_menu' ) ); @@ -275,14 +274,6 @@ public function activate( $plugin ) { } } - /** - * Filter functions. - */ - private function dashboard_widget_capability() { - $return = apply_filters( 'facebook_page_plugin_dashboard_widget_capability', 'edit_posts' ); - return $return; - } - /** * Get the Facebook App ID * @@ -317,7 +308,7 @@ public function donate_notice( $echo = false ) { } if ( $echo ) { - echo $return; + echo $return; // phpcs:ignore WordPress.Security.EscapeOutput } else { return $return; } @@ -381,25 +372,6 @@ public function register_assets() { public function admin_resources() { wp_enqueue_script( 'facebook-page-plugin-admin-scripts' ); wp_enqueue_style( 'facebook-page-plugin-admin-styles' ); - - } - - /** - * Register the dashboard widget - */ - public function facebook_page_plugin_dashboard_widget() { - if ( current_user_can( $this->dashboard_widget_capability() ) ) { - wp_add_dashboard_widget( 'facebook-page-plugin-shortcode-generator', __( 'Mongoose Page Plugin Shortcode Generator', 'facebook-page-feed-graph-api' ), array( $this, 'dashboard_widget_callback' ) ); - } - } - - /** - * Load the dashboard widget - */ - public function dashboard_widget_callback() { - echo ''; - $generator = new Mongoose_Page_Plugin_Shortcode_Generator(); - $generator->generate(); } /** @@ -409,7 +381,7 @@ public function dashboard_widget_callback() { */ public function landing_page_menu() { add_options_page( - __( 'Mongoose Page Plugin by Mongoose Marketplace', 'facebook-page-feed-graph-api' ), + __( 'Mongoose Page Plugin', 'facebook-page-feed-graph-api' ), 'Mongoose Page Plugin', 'install_plugins', 'mongoose-page-plugin', @@ -425,7 +397,6 @@ public function landing_page_menu() { public function facebook_page_plugin_landing_page() { wp_enqueue_style( 'facebook-page-plugin-landing-page-css' ); wp_enqueue_style( 'facebook-page-plugin-google-fonts' ); - wp_enqueue_script( 'facebook-page-plugin-landing-page-js' ); require_once trailingslashit( $this->dirpath ) . 'inc/templates/landing-page.php'; } @@ -439,7 +410,7 @@ public function facebook_page_plugin_latest_blog_posts_callback() { __( 'Latest plugin news', 'facebook-page-feed-graph-api' ) ); wp_widget_rss_output( 'http://www.rssmix.com/u/13155011/rss.xml', array( 'show_date' => 1 ) ); - wp_die( $links ); + wp_die( $links ); // phpcs:ignore WordPress.Security.EscapeOutput } /** @@ -491,7 +462,10 @@ public function facebook_page_plugin( $filter ) { if ( 'sdk' === $a['method'] ) { - $return .= ''; + $return .= sprintf( + '', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript + esc_attr( $a['language'] ) + ); $return .= sprintf( '