Plugin Directory

Changeset 2045316


Ignore:
Timestamp:
03/06/2019 02:37:23 PM (7 years ago)
Author:
semrush
Message:

Satisfy Wordpress-VIP-Go code style

Location:
semrush-seo-writing-assistant/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • semrush-seo-writing-assistant/trunk/admin/class-semrushswa-metabox.php

    r2030680 r2045316  
    22/**
    33 * The metabox functionality of the plugin
     4 * php version 5.2.4
    45 *
    5  * @link       https://www.semrush.com/
    6  * @since      1.0.0
    7  *
     6 * @category   SemrushSwa
    87 * @package    SemrushSwa
    98 * @subpackage SemrushSwa/metabox
     9 * @author     SEMrush CY LTD <apps@semrush.com>
     10 * @license    GPL-2.0+ <http://www.gnu.org/licenses/gpl-2.0.txt>
     11 * @link       https://www.semrush.com/
    1012 */
    1113
     
    1517 * Adds metabox area with div.
    1618 *
     19 * @category   SemrushSwa
    1720 * @package    SemrushSwa
    1821 * @subpackage SemrushSwa/metabox
    19  * @author     SEMrush <swa-feedback@semrush.com>
     22 * @author     SEMrush CY LTD <apps@semrush.com>
     23 * @license    GPL-2.0+ <http://www.gnu.org/licenses/gpl-2.0.txt>
     24 * @link       https://www.semrush.com/
    2025 */
    2126class SemrushSwa_MetaBox {
     
    3641    private function get_metabox_post_types() {
    3742        $default_post_types  = array( 'post', 'page', 'product' );
    38         $filtered_post_types = apply_filters( 'semrush_seo_writing_assistant_post_types', $default_post_types );
     43        $filtered_post_types = apply_filters(
     44            'semrush_seo_writing_assistant_post_types',
     45            $default_post_types
     46        );
    3947
    4048        return empty( $filtered_post_types )
     
    4553    /**
    4654     * Adds the meta box.
     55     *
     56     * @return void
    4757     */
    4858    public function add_metabox() {
     
    5868            wp_enqueue_script(
    5969                'swa_wordpress_js',
    60                 $custom_script_url ? $custom_script_url : '//www.semrush.com/swa/addon/nocache/js/wordpress.js',
     70                $custom_script_url
     71                    ? $custom_script_url
     72                    : '//www.semrush.com/swa/addon/nocache/js/wordpress.js',
    6173                array(),
    6274                SEMRUSH_SEO_WRITING_ASSISTANT_VERSION,
    6375                true
    6476            );
     77
    6578            add_meta_box(
    6679                'swa-meta-box',
     
    8194     * Renders the meta box.
    8295     *
    83      * @param WP_Post $post The current post.
     96     * @param WP_Post $post    The current post.
    8497     * @param array   $metabox With metabox id, title, callback, and args elements.
     98     *
     99     * @return void
    85100     */
    86101    public function render_metabox( $post, $metabox ) {
     
    88103        $swa_docurl = $metabox['args']['swa_docurl'];
    89104
    90         echo '<div id="swa-container" data-swa-docurl="' . esc_attr( $swa_docurl ) . '" data-swa-docid="' . esc_attr( $swa_docid ) . '"></div>';
     105        echo '<div id="swa-container" data-swa-docurl="' . esc_url( $swa_docurl ) . '" data-swa-docid="' . esc_attr( $swa_docid ) . '"></div>';
    91106    }
    92107
  • semrush-seo-writing-assistant/trunk/admin/index.php

    r1950877 r2045316  
    1 <?php // Blank
     1<?php
     2/**
     3 * The metabox functionality of the plugin
     4 * php version 5.2.4
     5 *
     6 * @package    SemrushSwa
     7 */
     8
     9// Just an empty file to avoid directory listing.
  • semrush-seo-writing-assistant/trunk/index.php

    r1950877 r2045316  
    1 <?php // Blank
     1<?php
     2/**
     3 * The metabox functionality of the plugin
     4 * php version 5.2.4
     5 *
     6 * @package    SemrushSwa
     7 */
     8
     9// Just an empty file to avoid directory listing.
  • semrush-seo-writing-assistant/trunk/readme.txt

    r1971087 r2045316  
    55Requires PHP: 5.2.4
    66Stable tag: trunk
    7 Tested up to: 5.0
     7Tested up to: 5.1
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • semrush-seo-writing-assistant/trunk/semrush-seo-writing-assistant.php

    r2030680 r2045316  
    88 * that starts the plugin.
    99 *
    10  * @link              https://www.semrush.com/
    11  * @since             1.0.0
    12  * @package           SemrushSwa
     10 * php version 5.2.4
     11 *
     12 * @category SemrushSwa
     13 * @package  SemrushSwa
     14 * @author   SEMrush CY LTD <apps@semrush.com>
     15 * @license  GPL-2.0+ <http://www.gnu.org/licenses/gpl-2.0.txt>
     16 * @link     https://www.semrush.com/
     17 * @since    1.0.0
    1318 *
    1419 * @wordpress-plugin
     
    4146 * not affect the page life cycle.
    4247 *
    43  * @since    1.0.0
     48 * @since  1.0.0
     49 * @return void
    4450 */
    4551function run_semrush_swa() {
     
    4753     * Load and initialize the metabox plugin.
    4854     */
    49     require_once dirname( __FILE__ ) . '/admin/class-semrushswa-metabox.php';
     55    include_once dirname( __FILE__ ) . '/admin/class-semrushswa-metabox.php';
    5056    new SemrushSwa_MetaBox();
    5157}
Note: See TracChangeset for help on using the changeset viewer.