Plugin Directory

Changeset 2644211


Ignore:
Timestamp:
12/14/2021 11:13:47 PM (4 years ago)
Author:
cleverplugins
Message:

3.8

  • Security update and 3rd party library updates.
Location:
seo-booster
Files:
602 added
29 edited

Legend:

Unmodified
Added
Removed
  • seo-booster/trunk/inc/class-404-pages-list-table.php

    r2286319 r2644211  
    8181    protected function column_lp( $item ) {
    8282
    83         $page = wp_unslash( $_REQUEST['page'] ); // WPCS: Input var ok.
     83        $page = sanitize_text_field( $_REQUEST['page'] );
    8484
    8585        // Build delete row action.
     
    124124            global $wpdb;
    125125            if ( isset( $_GET['fof'] ) ) {
    126                 if ( is_array( $_GET['fof'] ) ) {
    127                     foreach ( $_GET['fof'] as $fofid ) {
     126                $fofsan = sanitize_text_field( $_GET['fof'] );
     127                if ( is_array( $fofsan ) ) {
     128                    foreach ( $fofsan as $fofid ) {
    128129                        $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}sb2_404 WHERE id=%d limit 1;", $fofid) );
    129130                    }
     
    162163
    163164
     165    /**
     166     * prepare_items.
     167     *
     168     * @author  Unknown
     169     * @since   v0.0.1
     170     * @version v1.0.0  Tuesday, November 30th, 2021.
     171     * @return  void
     172     */
    164173    function prepare_items() {
    165174        global $wpdb;
     
    173182        $this->process_bulk_action();
    174183
    175         $paged = ( isset( $_GET['paged'] ) ) ? $_GET['paged'] : 1;
     184        $paged = ( isset( $_GET['paged'] ) ) ? intval( $_GET[ 'paged' ] ) : 1;
    176185
    177186        $offset = ( $paged * $per_page ) - $per_page;
    178187
    179         $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : false;
     188        $search = ( isset( $_REQUEST['s'] ) ) ? sanitize_key( $_REQUEST['s'] ) : false;
    180189
    181190        $do_search = ( $search ) ? $wpdb->prepare( " AND lp LIKE '%%%s%%' ", $search ) : '';
  • seo-booster/trunk/inc/class-autolink-list-table.php

    r2296640 r2644211  
    2121    /** Text displayed when no customer data is available */
    2222    public function no_items() {
    23         _e( 'No keyword to links made.', 'seo-booster' );
     23        esc_html_e( 'No keyword to links made.', 'seo-booster' );
    2424    }
    2525
     
    7676                return $item[ $column_name ];
    7777            default:
    78                 return print_r( $item, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r
    79                 // Show the whole array for troubleshooting purposes
     78                return wp_json_encode( $item, true );
    8079        }
    8180    }
     
    8685
    8786    protected function column_url( $item ) {
    88 
    89         $page = wp_unslash( $_REQUEST['page'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    9087        return sprintf(
    9188            '<a href="%1$s" target="_blank">%2$s</a>',
     
    113110    protected function column_lp( $item ) {
    114111
    115         $page = wp_unslash( $_REQUEST['page'] ); // WordPress.Security.NonceVerification.Recommended
     112        $page = sanitize_text_field( $_REQUEST['page'] );
    116113
    117114        // Build delete row action.
     
    147144
    148145
     146    /**
     147     * process_bulk_action.
     148     *
     149     * @author  Unknown
     150     * @since   v0.0.1
     151     * @version v1.0.0  Tuesday, November 30th, 2021.
     152     * @access  protected
     153     * @return  void
     154     */
    149155    protected function process_bulk_action() {
    150156
    151         if ( 'delete' === $this->current_action() ) {
     157        // security check!
     158        if ( isset( $_GET['_wpnonce'] ) && ! empty( $_GET['_wpnonce'] ) ) {
     159
     160        $nonce  = filter_input( INPUT_GET, '_wpnonce', FILTER_SANITIZE_STRING );
     161        $action = 'bulk-' . $this->_args['plural'];
     162
     163        if ( ! wp_verify_nonce( $nonce, $action ) )
     164            wp_die( 'Nope! Security check failed!' );
     165
     166    }
     167    if ( 'delete' === $this->current_action() ) {
    152168            global $wpdb;
    153             if ( isset( $_GET['alid'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    154                 if ( is_array( $_GET['alid'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    155                     foreach ( $_GET['alid'] as $alid ) {
     169            if ( isset( $_GET['alid'] ) ) {
     170
     171                $alidsan = $_GET['alid'];
     172
     173                if ( is_array( $alidsan ) ) {
     174                    foreach ( $alidsan as $alid ) {
    156175                        $alid = intval( $alid ); // just to be sure
    157                         $wpdb->query( "DELETE FROM {$wpdb->prefix}sb2_autolink WHERE id=$alid limit 1;" ); // @todo prepare
     176                        $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}sb2_autolink WHERE id=%d limit 1;", $alid ) );
    158177                    }
    159178                } else {
    160179                    $alid = intval( $_GET['alid'] );
    161                     $wpdb->query( "DELETE FROM {$wpdb->prefix}sb2_autolink WHERE id=$alid limit 1;" ); // @todo prepare
     180                    $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}sb2_autolink WHERE id=%d limit 1;", $alid) );
    162181                }
    163182            }
     
    200219        $this->process_bulk_action();
    201220
    202         $paged = ( isset( $_GET['paged'] ) ) ? $_GET['paged'] : 1;
     221        $paged = ( isset( $_GET['paged'] ) ) ? sanitize_text_field( $_GET['paged'] ) : 1;
    203222
    204223        $offset = ( $paged * $per_page ) - $per_page;
     
    254273     */
    255274    protected function usort_reorder( $a, $b ) {
    256         $orderby = ! empty( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : 'lastcrawl';
    257 
    258         $order = ! empty( $_REQUEST['order'] ) ? wp_unslash( $_REQUEST['order'] ) : 'desc';
     275        $orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : 'lastcrawl';
     276
     277        $order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : 'desc';
    259278
    260279        $result = strcmp( $a[ $orderby ], $b[ $orderby ] );
  • seo-booster/trunk/inc/class-crawled-pages-list-table.php

    r2296640 r2644211  
    6363
    6464
     65    /**
     66     * column_url.
     67     *
     68     * @author  Unknown
     69     * @since   v0.0.1
     70     * @version v1.0.0  Tuesday, November 30th, 2021.
     71     * @access  protected
     72     * @param   mixed   $item   
     73     * @return  mixed
     74     */
    6575    protected function column_url( $item ) {
    66 
    67         $page = wp_unslash( $_REQUEST['page'] ); // WPCS: Input var ok.
    6876
    6977        // Return the title contents.
     
    123131        $this->process_bulk_action();
    124132
    125         $paged = ( isset( $_GET['paged'] ) ) ? $_GET['paged'] : 1;
     133        $paged = ( isset( $_GET['paged'] ) ) ? sanitize_text_field( $_GET['paged'] ) : 1;
    126134
    127135        $offset = ( $paged * $per_page ) - $per_page;
    128136
    129         $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : false;
     137        $search = ( isset( $_REQUEST['s'] ) ) ? sanitize_text_field( $_REQUEST['s'] ) : false;
    130138
    131139        if ( $search ) {
     
    156164            foreach ( $data as $da ) {
    157165                $daurl    = $da['url'];
    158                 $crawlers = $wpdb->get_results( "SELECT id,engine,SUM(visits) as visits,lastcrawl FROM {$wpdb->prefix}sb2_crawl WHERE url='$daurl' GROUP BY engine;" );
     166                $crawlers = $wpdb->get_results( $wpdb->prepare( "SELECT id,engine,SUM(visits) as visits,lastcrawl FROM {$wpdb->prefix}sb2_crawl WHERE url=%s GROUP BY engine;", $daurl) );
    159167
    160168                //$crawlout = '##todo##';
     
    178186        $current_page = $this->get_pagenum();
    179187
    180         $total_items = $wpdb->get_var( "SELECT count(DISTINCT(url)) FROM {$wpdb->prefix}sb2_crawl WHERE 1=1 $do_search;" );
     188        $total_items = $wpdb->get_var( "SELECT count(DISTINCT(url)) FROM {$wpdb->prefix}sb2_crawl WHERE 1=1 {$do_search};" );
    181189
    182190        $this->items = $data;
     
    200208     */
    201209    protected function usort_reorder( $a, $b ) {
    202         $orderby = ! empty( $_REQUEST['orderby'] ) ? wp_unslash( $_REQUEST['orderby'] ) : 'lastcrawl';
    203 
    204         $order = ! empty( $_REQUEST['order'] ) ? wp_unslash( $_REQUEST['order'] ) : 'desc';
     210        $orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_key( $_REQUEST['orderby'] ) : 'lastcrawl';
     211
     212        $order = ! empty( $_REQUEST['order'] ) ? sanitize_key( $_REQUEST['order'] ) : 'desc';
    205213
    206214        $result = strcmp( $a[ $orderby ], $b[ $orderby ] );
  • seo-booster/trunk/inc/class-forgotten-pages-list-table.php

    r2286319 r2644211  
    4444                $bltable = $wpdb->prefix . 'sb2_bl';
    4545                $count = 0;
    46                 if ( is_array( $_GET['url'] ) ) {
    47                     foreach ( $_GET['url'] as $urlid ) {
    48                         $wpdb->query( $wpdb->prepare( "DELETE FROM {$bltable} WHERE id=%d limit 1;" ), $urlid );
     46                $urlsan = sanitize_text_field( $_GET['url'] );
     47                if ( is_array( $urlsan ) ) {
     48                    foreach ( $urlsan as $urlid ) {
     49                        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bltable} WHERE id=%d limit 1;" ), intval( $urlid) );
    4950                        $count++;
    5051                    }
     
    7879    }
    7980   
    80     protected function column_lp( $item )
    81     {
    82         $page = wp_unslash( $_REQUEST['page'] );
     81    /**
     82     * column_lp.
     83     *
     84     * @author  Unknown
     85     * @since   v0.0.1
     86     * @version v1.0.0  Tuesday, November 30th, 2021.
     87     * @access  protected
     88     * @param   mixed   $item   
     89     * @return  mixed
     90     */
     91    protected function column_lp( $item ) {
    8392        return sprintf(
    8493            '<a href="%1$s" target="_blank">%2$s</a> <span style="color:silver;">(Visitors:%3$s)</span>',
    85             site_url( $item['lp'] ),
     94            esc_url( site_url( $item['lp'] ) ),
    8695            $item['lp'],
    8796            $item['visits']
     
    128137        $order = ( !empty($order) ? esc_sql( strtoupper( sanitize_text_field( $order ) ) ) : 'ASC' );
    129138        $order = $this->sanitize_order( $order );
    130         $daquery = "SELECT id,kw,lp,visits,firstvisit,lastvisit,min(firstvisit)\n\t\tFROM {$kwtable}\n\t\tWHERE engine<>'Internal Search'\n\t\tAND visits>1\n\t\tAND kw<>'#'\n\t\tAND ( (lastvisit < DATE_SUB(NOW(), INTERVAL 30 DAY) ) or (firstvisit < DATE_SUB(NOW(), INTERVAL 30 DAY) ) )\n\t\tGROUP BY lp\n\t\tORDER BY {$orderby} {$order}\n\t\tLIMIT {$offset}, {$per_page};";
     139
     140        $daquery = "SELECT id,kw,lp,visits,firstvisit,lastvisit,min(firstvisit) FROM {$kwtable} WHERE engine<>'Internal Search' AND visits>1 AND kw<>'#' AND ( (lastvisit < DATE_SUB(NOW(), INTERVAL 30 DAY) ) or (firstvisit < DATE_SUB(NOW(), INTERVAL 30 DAY) ) ) GROUP BY lp ORDER BY {$orderby} {$order} LIMIT {$offset}, {$per_page};";
    131141        // @todo - lav query der henter data på sideniveua, dvs. man kunne have fået besøg af "blue widget" før, men efterfølgende er der blot "#" - det skal der tages højde for.
    132142        $data = $wpdb->get_results( $daquery, ARRAY_A );
     
    150160                }
    151161            }
    152             $newdat['kws'] = $kwstring;
     162            $newdat['kws'] = wp_kses( $kwstring, wp_allowed_protocols() );
    153163            $newarr[] = $newdat;
    154164        }
  • seo-booster/trunk/inc/class-sb-backlink-pages-list-table.php

    r2317644 r2644211  
    2525            $classnames .= ' sesuspect';
    2626        }
    27         echo  "<tr id='backlink-" . $item['id'] . "' class='{$classnames}'>" ;
     27        echo  "<tr id='backlink-" . esc_attr( $item['id'] ) . "' class='". esc_attr( $classnames ) ."'>" ;
    2828        WP_List_Table::single_row_columns( $item );
    2929        echo  "</tr>\n" ;
     
    122122                }
    123123               
    124                 $img = '<img src="' . $imgurl . '" class="flag" alt="' . $imgalt . '">';
     124                $img = '<img src="' . esc_url( $imgurl ) . '" class="flag" alt="' . esc_attr ( $imgalt ) . '">';
    125125                $imgurl = add_query_arg( array(
    126126                    'w' => '250',
    127127                ), '//s.wordpress.com/mshots/v1/' . urlencode( $item['ref'] ) );
    128                 $screenshot = "<img data-original='{$imgurl}' src='" . SEOBOOSTER_PLUGINURL . "images/blplaceholder.png' width='125' height='93' class='lazy mshot'>";
    129                 return $img . '<a href="' . $item['ref'] . '" target="_blank">' . $seobooster2->truncatestring( $seobooster2->remove_http( $item['ref'] ), 35 ) . '</br>' . $screenshot . '</a>';
     128               
     129                $screenshot = "<img data-original='". esc_url( $imgurl ). "' src='" . esc_url( SEOBOOSTER_PLUGINURL . 'images/blplaceholder.png') ."' width='125' height='93' class='lazy mshot'>";
     130                return $img . '<a href="' . esc_attr( $item['ref'] ) . '" target="_blank">' . $seobooster2->truncatestring( $seobooster2->remove_http( $item['ref'] ), 35 ) . '</br>' . $screenshot . '</a>';
    130131            case 'httpstatus':
    131                 return $item[$column_name];
     132                return esc_attr( $item[$column_name] );
    132133            case 'lp':
    133                 return $seobooster2->truncatestring( $seobooster2->remove_http( $item['lp'] ), 55 );
     134                return esc_attr( $seobooster2->truncatestring( $seobooster2->remove_http( $item['lp'] ), 55 ) );
    134135            case 'visits':
    135                 return $item[$column_name];
     136                return esc_attr( $item[$column_name] );
    136137            case 'firstvisit':
    137                 return $item[$column_name];
     138                return esc_attr( $item[$column_name] );
    138139            default:
    139140                return '';
     
    143144    protected function column_cb( $item )
    144145    {
    145         return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_args['singular'], urlencode( $item['id'] ) );
     146        return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_args['singular'], esc_attr( $item['id'] ) );
    146147    }
    147148   
     
    154155    }
    155156   
     157    /**
     158     * process_bulk_action.
     159     *
     160     * @author  Lars Koudal
     161     * @since   v0.0.1
     162     * @version v1.0.0  Tuesday, December 14th, 2021.
     163     * @access  protected
     164     * @return  void
     165     */
    156166    protected function process_bulk_action()
    157167    {
     
    163173                $bltable = $wpdb->prefix . 'sb2_bl';
    164174                $count = 0;
    165                 if ( is_array( $_GET['url'] ) ) {
    166                     foreach ( $_GET['url'] as $urlid ) {
     175                $urlsan = sanitize_text_field( $_GET['url'] );
     176                if ( is_array( $urlsan ) ) {
     177                    foreach ( $urlsan as $urlid ) {
    167178                        $wpdb->delete( $bltable, array(
    168                             'id' => $urlid,
     179                            'id' => intval( $urlid ),
    169180                        ), array( '%d' ) );
    170181                        $count++;
     
    202213    }
    203214   
     215    /**
     216     * prepare_items.
     217     *
     218     * @author  Unknown
     219     * @since   v0.0.1
     220     * @version v1.0.0  Tuesday, November 30th, 2021.
     221     * @return  void
     222     */
    204223    function prepare_items()
    205224    {
     
    211230        $this->_column_headers = array( $columns, $hidden, $sortable );
    212231        $this->process_bulk_action();
    213         $paged = ( isset( $_GET['paged'] ) ? intval( $_GET['paged'] ) : 1 );
     232        $paged = ( isset( $_GET['paged'] ) ? sanitize_text_field( $_GET['paged'] ) : 1 );
    214233        $offset = $paged * $per_page - $per_page;
    215234        $bltable = $wpdb->prefix . 'sb2_bl';
     
    233252        $order = ( !empty($order) ? esc_sql( strtoupper( sanitize_text_field( $order ) ) ) : 'ASC' );
    234253        $order = $this->sanitize_order( $order );
    235         $daquery = "SELECT * FROM `{$bltable}` WHERE 1 = 1 {$do_search} ORDER BY {$orderby} {$order} LIMIT {$offset}, {$per_page};";
     254        $daquery = "SELECT * FROM {$wpdb->prefix}sb2_bl WHERE 1 = 1 {$do_search} ORDER BY {$orderby} {$order} LIMIT {$offset}, {$per_page};";
    236255        $data = $wpdb->get_results( $daquery, ARRAY_A );
    237256        $current_page = $this->get_pagenum();
    238         $total_items = $wpdb->get_var( "SELECT count(lp) FROM `{$bltable}` WHERE 1=1 {$do_search};" );
     257        $total_items = $wpdb->get_var( "SELECT count(lp) FROM {$wpdb->prefix}sb2_bl WHERE 1=1 {$do_search};" );
    239258        $this->items = $data;
    240259        $this->set_pagination_args( array(
     
    245264    }
    246265   
     266    /**
     267     * usort_reorder.
     268     *
     269     * @author  Unknown
     270     * @since   v0.0.1
     271     * @version v1.0.0  Tuesday, November 30th, 2021.
     272     * @access  protected
     273     * @param   mixed   $a 
     274     * @param   mixed   $b 
     275     * @return  mixed
     276     */
    247277    protected function usort_reorder( $a, $b )
    248278    {
    249         $orderby = ( !empty($_REQUEST['orderby']) ? wp_unslash( $_REQUEST['orderby'] ) : 'firstvisit' );
    250         $order = ( !empty($_REQUEST['order']) ? wp_unslash( $_REQUEST['order'] ) : 'asc' );
     279        $orderby = ( !empty($_REQUEST['orderby']) ? sanitize_text_field( $_REQUEST['orderby'] ) : 'firstvisit' );
     280        $order = ( !empty($_REQUEST['order']) ? sanitize_text_field( $_REQUEST['order'] ) : 'asc' );
    251281        $result = strcmp( $a[$orderby], $b[$orderby] );
    252282        return ( 'asc' === $order ? $result : -$result );
  • seo-booster/trunk/inc/class-seobooster-dyn-widget.php

    r2357483 r2644211  
    2020        $listtype   = $instance['listtype'];
    2121        $limit      = $instance['limit'];
    22         $showvisits = $instance['showvisits'];
     22        if (isset($instance['showvisits'])) {
     23            $showvisits = $instance['showvisits'];
     24        }
     25        else {
     26            $showvisits = false;
     27        }
    2328
    2429        $output = $before_widget;
     
    2631            $output .= $before_title . $title . $after_title;
    2732        }
    28         $kwtable = $wpdb->prefix . 'sb2_kw';
     33
    2934        global $wp_query;
    3035
     
    4045        if ( 'hightraffic' === $listtype ) {
    4146            // high traffic
    42             $query = "SELECT DISTINCT lp,kw,lastvisit,visits FROM $kwtable M WHERE $sqlignore ig='0' AND kw<>'#' AND lp<>'$currurl' AND engine<>'Internal Search' group by kw ORDER BY visits DESC LIMIT $limit;";
     47            $query = "SELECT DISTINCT lp,kw,lastvisit,visits FROM {$wpdb->prefix}sb2_kw WHERE $sqlignore ig='0' AND kw<>'#' AND lp<>'$currurl' AND engine<>'Internal Search' group by kw ORDER BY visits DESC LIMIT $limit;";
    4348        }
    4449
    4550        if ( 'lowtraffic' === $listtype ) {
    4651            // low traffic
    47             $query = "SELECT DISTINCT lp,kw,lastvisit,visits FROM $kwtable M WHERE $sqlignore ig='0' AND kw<>'#' AND lp<>'$currurl' AND engine<>'Internal Search' GROUP BY kw  ORDER BY visits ASC LIMIT $limit;";
     52            $query = "SELECT DISTINCT lp,kw,lastvisit,visits FROM {$wpdb->prefix}sb2_kw WHERE $sqlignore ig='0' AND kw<>'#' AND lp<>'$currurl' AND engine<>'Internal Search' GROUP BY kw  ORDER BY visits ASC LIMIT $limit;";
    4853        }
    4954
    5055        if ( 'latest' === $listtype ) {
    5156            // show latest keywords
    52             $query = "SELECT DISTINCT lp,kw,lastvisit,visits FROM $kwtable M WHERE $sqlignore ig='0' AND kw<>'#' AND lp<>'$currurl' AND engine<>'Internal Search' GROUP BY kw ORDER BY lastvisit ASC LIMIT $limit;";
     57            $query = "SELECT DISTINCT lp,kw,lastvisit,visits FROM {$wpdb->prefix}sb2_kw WHERE $sqlignore ig='0' AND kw<>'#' AND lp<>'$currurl' AND engine<>'Internal Search' GROUP BY kw ORDER BY lastvisit ASC LIMIT $limit;";
    5358        }
    5459
     
    6267                $permalink = $ph['lp'];
    6368                if ( $permalink ) {
    64                     $output .= "<li><a href='" . $permalink . "'>" . ucfirst( stripslashes( $ph['kw'] ) ) . '</a>';
     69                    $output .= "<li><a href='" . esc_url( $permalink ) . "'>" . esc_attr( ucfirst( stripslashes( $ph['kw'] ) ) ) . '</a>';
    6570
    6671                    if ( $showvisits ) {
     
    7782            $output = '';
    7883        }
    79         echo $output;
     84        echo wp_kses( $output, wp_allowed_protocols() );
    8085    }
    8186
  • seo-booster/trunk/inc/class-seobooster-keywords-widget.php

    r2357483 r2644211  
    3131        $output .= $before_widget;
    3232        if ( ! empty( $title ) ) {
    33             $output .= $before_title . $title . $after_title;
     33            $output .= $before_title . esc_attr( $title ) . $after_title;
    3434        }
    35         $output .= '<div style="padding:20px;">' . $keywords . '</div>'; // todo - use builtin classes possible? .textwidget
     35        $output .= '<div style="padding:20px;">' . $keywords . '</div>';
    3636        $output .= $after_widget;
    37         echo $output;
     37        echo wp_kses( $output, wp_allowed_protocols() );
    3838    }
    3939
  • seo-booster/trunk/inc/simple_html_dom.php

    r2194133 r2644211  
    874874         *     Matches the selector list separator
    875875         */
    876         // phpcs:ignore Generic.Files.LineLength
    877876        $pattern = "/([\w:\*-]*)(?:\#([\w-]+))?(?:|\.([\w\.-]+))?((?:\[@?(?:!?[\w:-]+)(?:(?:[!*^$|~]?=)[\"']?(?:.*?)[\"']?)?(?:\s*?(?:[iIsS])?)?\])+)?([\/, >+~]+)/is";
    878877
  • seo-booster/trunk/readme.txt

    r2637115 r2644211  
    66Requires PHP: 5.6
    77Tested up to: 5.8.2
    8 Stable tag: 3.8
     8Stable tag: 3.8.1
    99
    1010Not your usual SEO plugin - Discover new keywords + automatic links + discover new incoming links + 404 error monitoring and much more.
  • seo-booster/trunk/seo-booster-keywords.php

    r2637115 r2644211  
    1111$kwdttable = $wpdb->prefix . 'sb2_kwdt';
    1212if ( isset( $_COOKIE['sbp_kw_length'] ) ) {
    13     $the_length = $_COOKIE['sbp_kw_length'];
     13    $the_length = sanitize_key( $_COOKIE['sbp_kw_length'] );
    1414}
    1515
    1616if ( isset( $_COOKIE['sbp_the_showkws'] ) ) {
    17     $the_showkws = $_COOKIE['sbp_the_showkws'];
     17    $the_showkws = sanitize_key( $_COOKIE['sbp_the_showkws'] );
    1818} else {
    1919    $the_showkws = 'all';
     
    2222
    2323if ( isset( $_COOKIE['sbp_kw_hideinternal'] ) ) {
    24     $the_hideinternal = $_COOKIE['sbp_kw_hideinternal'];
     24    $the_hideinternal = sanitize_key( $_COOKIE['sbp_kw_hideinternal'] );
    2525} else {
    2626    $the_hideinternal = '';
     
    4141    <?php
    4242    if ( isset( $_COOKIE['sbp_kw_length'] ) ) {
    43         $the_length = $_COOKIE['sbp_kw_length'];
     43        $the_length = sanitize_key( $_COOKIE['sbp_kw_length'] );
    4444    }
    4545    if ( isset( $_COOKIE['sbp_the_showkws'] ) ) {
    46         $the_showkws = $_COOKIE['sbp_the_showkws'];
     46        $the_showkws = sanitize_key( $_COOKIE['sbp_the_showkws'] );
    4747    }
    4848    if ( isset( $_COOKIE['sbp_kw_hideinternal'] ) ) {
    49         $the_hideinternal = $_COOKIE['sbp_kw_hideinternal'];
     49        $the_hideinternal = sanitize_key( $_COOKIE['sbp_kw_hideinternal'] );
    5050    }
    5151    ?>
     
    108108
    109109    <div id="datatable-target"></div>
    110     <table cellpadding="0" cellspacing="0" border="0" class="wp-list-table widefat" id="datatable">
     110    <table cellpadding="0" cellspacing="0" class="wp-list-table widefat" id="datatable">
    111111        <thead>
    112112            <tr>
     
    181181        </tfoot>
    182182    </table>
    183 
    184 
    185183    <hr>
    186 
    187184    <?php
    188     $query       = "SELECT engine, COUNT(*) as cnt, SUM(visits) as visits FROM {$wpdb->prefix}sb2_kw where `ig`='0' AND `kw`<>'#' AND engine<>'Internal Search' GROUP BY `engine` ORDER BY `visits` DESC limit 25;";
    189     $engines     = $wpdb->get_results( $query, ARRAY_A ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     185
     186    $engines     = $wpdb->get_results( $wpdb->prepare( "SELECT engine, COUNT(*) as cnt, SUM(visits) as visits FROM {$wpdb->prefix}sb2_kw where `ig`='0' AND `kw`<>'#' AND engine <> %s GROUP BY %s ORDER BY `visits` DESC limit 25;", 'Internal Search', 'engine'), ARRAY_A );
    190187    $enginecount = count( $engines );
    191188
     
    231228                    <tr>
    232229                        <td>
    233                         <?php
    234                         echo esc_attr( $position );
    235                         ?>
    236         </td>
     230                            <?php
     231                            echo esc_attr( $position );
     232                            ?>
     233                        </td>
    237234                        <td>
    238235                        <?php
  • seo-booster/trunk/seo-booster-log.php

    r2637115 r2644211  
    2222        if ( ! empty( $_POST ) && check_admin_referer( 'reset_log', 'seobooster2_nonce' ) ) {
    2323
    24             if ( isset( $_POST['sb2_log_action'] ) && 'resetlog' === $_POST['sb2_log_action'] ) {
     24            if ( isset( $_POST['sb2_log_action'] ) && 'resetlog' === sanitize_text_field( $_POST['sb2_log_action'] ) ) {
    2525                $wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}sb2_log;" );
    26                 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    27                 this::log( __( 'Log emptied manually', 'seo-booster' ) );
     26                $seobooster2::log( __( 'Log emptied manually', 'seo-booster' ) );
    2827            }
    2928        }
  • seo-booster/trunk/seo-booster-seobooster2.php

    r2637115 r2644211  
    99global  $wpdb, $seobooster_fs;
    1010$foftable = $wpdb->prefix . 'sb2_404';
    11 $bltable  = $wpdb->prefix . 'sb2_bl';
     11
    1212?>
    1313<div class="wrap">
     
    3232    // TESTING AND FIXING DATABASE TABLES
    3333
    34     if ( isset( $_POST['page'] ) && 'sb2_dashboard' === $_POST['page'] ) {
    35         $nonce = $_REQUEST['_wpnonce'];
     34    if ( isset( $_POST['page'] ) && 'sb2_dashboard' === sanitize_text_field( $_POST['page'] ) ) {
     35        $nonce = sanitize_text_field( $_REQUEST['_wpnonce'] );
    3636
    3737        if ( ! wp_verify_nonce( $nonce, 'fixdbtables' ) ) {
     
    9494
    9595            <form id="fixdatabase" method="post">
    96                 <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
     96                <input type="hidden" name="page" value="<?php echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) ); ?>" />
    9797                <input type="hidden" name="action" value="sbp_fixdatabasetables" />
    9898                <input type="hidden" name="_wpnonce" value="
     
    164164                            $latestlimit = 10;
    165165                            $latestkws   = $wpdb->get_results( "SELECT kw, engine, firstvisit FROM {$wpdb->prefix}sb2_kw WHERE `engine` NOT LIKE 'Internal Search' AND `kw`<>'#' GROUP BY kw ORDER BY visits ASC LIMIT {$latestlimit};" );
    166                             //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    167166
    168167                            if ( $latestkws ) {
     
    181180
    182181                        $totalbls = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}sb2_bl;" );
    183 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    184182
    185183                        if ( $totalbls > 0 ) {
    186184                            $show_welcome_text = false;
    187185                            // translators:
    188                             echo '<p class="quickie">' . sprintf( __( 'Found <span>%s</span>  external links from visitors.', 'seo-booster' ), esc_html( number_format_i18n( $totalbls ) ), esc_html( number_format_i18n( $totalengines ) ) ) . '</p>';
     186                            echo esc_html( '<p class="quickie">' . sprintf( __( 'Found <span>%s</span>  external links from visitors.', 'seo-booster' ),  number_format_i18n( $totalbls ) ,  number_format_i18n( $totalengines ) ) . '</p>', wp_kses_allowed_html() );
    189187                        }
    190188
     
    194192                            $show_welcome_text = false;
    195193                            // translators: %s - number of 404 errors - pages and links not found
    196                             echo '<p class="quickie">' . sprintf( __( 'Detected <span>%s</span> not found pages and links.', 'seo-booster' ), esc_html( number_format_i18n( $totalfofs ) ) ) . '</p>';
     194                            echo esc_html( '<p class="quickie">' . sprintf( __( 'Detected <span>%s</span> not found pages and links.', 'seo-booster' ),  number_format_i18n( $totalfofs ) ) . '</p>' );
    197195                        }
    198196
     
    229227                        </h3>
    230228                        <ul>
    231 
    232                                                         <li><a href="https://wordpress.org/support/plugin/seo-booster/" target="_blank">
     229                            <li><a href="https://wordpress.org/support/plugin/seo-booster/" target="_blank">
    233230                            <?php
    234231                            esc_html_e( 'WP Support Forum', 'seo-booster' );
     
    248245                            ?>
    249246                            ">
    250 <?php
    251 esc_html_e( 'The Settings', 'seo-booster' );
    252 ?>
    253 </a></li>
     247                            <?php
     248                            esc_html_e( 'The Settings', 'seo-booster' );
     249                            ?>
     250                            </a></li>
    254251                            <li><a href="
    255252                            <?php
     
    257254                            ?>
    258255                            ">
    259 <?php
    260 esc_html_e( 'Keyword Details', 'seo-booster' );
    261 ?>
    262 </a></li>
     256                            <?php
     257                            esc_html_e( 'Keyword Details', 'seo-booster' );
     258                            ?>
     259                            </a></li>
    263260                            <li><a href="
    264261                            <?php
     
    266263                            ?>
    267264                            ">
    268 <?php
    269 esc_html_e( 'Backlink Details', 'seo-booster' );
    270 ?>
    271 </a></li>
     265                            <?php
     266                            esc_html_e( 'Backlink Details', 'seo-booster' );
     267                            ?>
     268                            </a></li>
    272269                            <li><a href="
    273270                            <?php
     
    275272                            ?>
    276273                            ">
    277 <?php
    278 esc_html_e( 'Crawled Pages', 'seo-booster' );
    279 ?>
    280 </a></li>
     274                            <?php
     275                            esc_html_e( 'Crawled Pages', 'seo-booster' );
     276                            ?>
     277                            </a></li>
    281278                            <li><a href="
    282279                            <?php
     
    284281                            ?>
    285282                            ">
    286 <?php
    287 esc_html_e( '404 Errors', 'seo-booster' );
    288 ?>
    289 </a></li>
     283                            <?php
     284                            esc_html_e( '404 Errors', 'seo-booster' );
     285                            ?>
     286                            </a></li>
    290287                            <li><a href="
    291288                            <?php
     
    293290                            ?>
    294291                            ">
    295 <?php
    296 esc_html_e( 'Forgotten Pages', 'seo-booster' );
    297 ?>
    298 </a></li>
     292                            <?php
     293                            esc_html_e( 'Forgotten Pages', 'seo-booster' );
     294                            ?>
     295                            </a></li>
    299296                            <li><a href="
    300297                            <?php
     
    302299                            ?>
    303300                            ">
    304 <?php
    305 esc_html_e( 'The Log', 'seo-booster' );
    306 ?>
    307 </a></li>
     301                            <?php
     302                            esc_html_e( 'The Log', 'seo-booster' );
     303                            ?>
     304                            </a></li>
    308305                        </ul>
    309306                    </div>
    310 
    311307                </div><!-- .wp-columns -->
    312 
    313308            </div><!-- .welcome-panel-content -->
    314309        </div><!--#inner-welcome-->
     
    316311
    317312    <?php
    318     $searchtrafficbyday_query = "SELECT daday, sum(visits) as totalvisits FROM {$wpdb->prefix}sb2_kwdt WHERE daday > DATE_SUB(NOW(), INTERVAL 120 DAY) GROUP BY daday ORDER BY daday ASC";
    319     $searchtrafficbyday       = $wpdb->get_results( $searchtrafficbyday_query ); //phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     313    $searchtrafficbyday_query = $wpdb->prepare( "SELECT daday, sum(visits) as totalvisits FROM {$wpdb->prefix}sb2_kwdt WHERE daday > DATE_SUB(NOW(), INTERVAL 120 DAY) GROUP BY daday ORDER BY daday ASC" );
     314
     315    $searchtrafficbyday = $wpdb->get_results( $searchtrafficbyday_query );
    320316
    321317    if ( $searchtrafficbyday ) {
     
    457453        $query   = "SELECT engine, COUNT(*) as cnt, SUM(visits) as visits FROM {$wpdb->prefix}sb2_kw WHERE `ig`='0' AND engine<>'Internal Search' GROUP BY `engine` ORDER BY `visits` DESC LIMIT 35;";
    458454        $engines = $wpdb->get_results( $query, ARRAY_A );
    459 //phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
    460455
    461456        if ( $engines ) {
     
    537532        </p>
    538533        <?php
    539         $totalbls = $wpdb->get_var( "SELECT count(*) FROM {$bltable};" );
    540 //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    541         $totalblsignore = $wpdb->get_var( "SELECT count(*) FROM {$bltable} WHERE ig='1';" );
    542 //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    543         $totalblsverified = $wpdb->get_var( "SELECT count(*) FROM {$bltable} WHERE verified='1' AND ig<>'1';" );
    544 //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    545         $totalblsvisits = $wpdb->get_var( "SELECT SUM(visits) FROM {$bltable};" );
    546 //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    547         $totalblsignorevisits = $wpdb->get_var( "SELECT SUM(visits) FROM {$bltable} WHERE ig='1';" );
    548 //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    549         $totalblsverifiedvisits = $wpdb->get_var( "SELECT SUM(visits) FROM {$bltable} WHERE verified='1' AND ig<>'1';" );
    550 //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
     534        $totalbls = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}sb2_bl;" );
     535        $totalblsignore = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}sb2_bl WHERE ig='1';" );
     536        $totalblsverified = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}sb2_bl WHERE verified='1' AND ig<>'1';" );
     537        $totalblsvisits = $wpdb->get_var( "SELECT SUM(visits) FROM {$wpdb->prefix}sb2_bl;" );
     538        $totalblsignorevisits = $wpdb->get_var( "SELECT SUM(visits) FROM {$wpdb->prefix}sb2_bl WHERE ig='1';" );
     539        $totalblsverifiedvisits = $wpdb->get_var( "SELECT SUM(visits) FROM {$wpdb->prefix}sb2_bl WHERE verified='1' AND ig<>'1';" );
    551540        ?>
    552541        <table class="wp-list-table widefat">
  • seo-booster/trunk/seo-booster-settings.php

    r2637115 r2644211  
    99global  $wpdb, $seobooster2;
    1010
    11 if ( isset( $_POST['page'] ) && 'sb2_settings' === $_POST['page'] ) {
    12     // todo - verify nonce
    13     $nonce = $_REQUEST['_wpnonce'];
     11if ( isset( $_POST['page'] ) && 'sb2_settings' === sanitize_text_field( $_POST['page'] ) ) {
     12
     13    $nonce = sanitize_text_field( $_REQUEST['_wpnonce'] );
    1414    if ( ! wp_verify_nonce( $nonce, 'seobooster_save_settings' ) ) {
    1515        die( 'Security check' );
    1616    }
    17     // todo - merge in to one option
     17
     18   
    1819    // todo - to anyone reading this, yes - I need to review the settings API.
    1920
    2021    if ( isset( $_POST['seobooster_internal_linking'] ) ) {
    21         update_option( 'seobooster_internal_linking', esc_attr( $_POST['seobooster_internal_linking'] ) );
     22        update_option( 'seobooster_internal_linking', sanitize_key( $_POST['seobooster_internal_linking'] ) );
    2223    } else {
    2324        delete_option( 'seobooster_internal_linking' );
     
    2627
    2728    if ( isset( $_POST['seobooster_replace_kw_multiple'] ) ) {
    28         update_option( 'seobooster_replace_kw_multiple', esc_attr( $_POST['seobooster_replace_kw_multiple'] ) );
     29        update_option( 'seobooster_replace_kw_multiple', sanitize_key( $_POST['seobooster_replace_kw_multiple'] ) );
    2930    } else {
    3031        delete_option( 'seobooster_replace_kw_multiple' );
     
    3233
    3334    if ( isset( $_POST['seobooster_dynamic_tag_taxonomy'] ) ) {
    34         update_option( 'seobooster_dynamic_tag_taxonomy', esc_attr( $_POST['seobooster_dynamic_tag_taxonomy'] ) );
     35        update_option( 'seobooster_dynamic_tag_taxonomy',  sanitize_key( $_POST['seobooster_dynamic_tag_taxonomy'] ) );
    3536    }
    3637    if ( isset( $_POST['seobooster_dynamic_tag_maximum'] ) ) {
    37         update_option( 'seobooster_dynamic_tag_maximum', esc_attr( $_POST['seobooster_dynamic_tag_maximum'] ) );
     38        update_option( 'seobooster_dynamic_tag_maximum', sanitize_key($_POST['seobooster_dynamic_tag_maximum'] ) );
    3839    }
    3940    if ( isset( $_POST['seobooster_dynamic_tag_minlength'] ) ) {
    40         update_option( 'seobooster_dynamic_tag_minlength', esc_attr( $_POST['seobooster_dynamic_tag_minlength'] ) );
     41        update_option( 'seobooster_dynamic_tag_minlength', sanitize_key($_POST['seobooster_dynamic_tag_minlength'] ) );
    4142    }
    4243    if ( isset( $_POST['seobooster_dynamic_tag_maxlength'] ) ) {
    43         update_option( 'seobooster_dynamic_tag_maxlength', esc_attr( $_POST['seobooster_dynamic_tag_maxlength'] ) );
     44        update_option( 'seobooster_dynamic_tag_maxlength', sanitize_key($_POST['seobooster_dynamic_tag_maxlength'] ) );
    4445    }
    4546    if ( isset( $_POST['seobooster_pagespeed_api_key'] ) ) {
    46         update_option( 'seobooster_pagespeed_api_key', esc_attr( $_POST['seobooster_pagespeed_api_key'] ) );
     47        update_option( 'seobooster_pagespeed_api_key', sanitize_text_field( $_POST['seobooster_pagespeed_api_key'] ) );
    4748    }
    4849    if ( isset( $_POST['seobooster_pagespeed_url_limit'] ) ) {
    49         update_option( 'seobooster_pagespeed_url_limit', esc_attr( $_POST['seobooster_pagespeed_url_limit'] ) );
     50        update_option( 'seobooster_pagespeed_url_limit', sanitize_text_field( $_POST['seobooster_pagespeed_url_limit'] ) );
    5051    }
    5152
    5253    if ( isset( $_POST['seobooster_enable_pagespeed'] ) ) {
    53         update_option( 'seobooster_enable_pagespeed', esc_attr( $_POST['seobooster_enable_pagespeed'] ) );
     54        update_option( 'seobooster_enable_pagespeed', sanitize_key( $_POST['seobooster_enable_pagespeed'] ) );
    5455    } else {
    5556        delete_option( 'seobooster_enable_pagespeed' );
     
    5758
    5859    if ( isset( $_POST['seobooster_replace_kw_limit'] ) ) {
    59         update_option( 'seobooster_replace_kw_limit', esc_attr( $_POST['seobooster_replace_kw_limit'] ) );
     60        update_option( 'seobooster_replace_kw_limit', sanitize_text_field( $_POST['seobooster_replace_kw_limit'] ) );
    6061    }
    6162
    6263    if ( isset( $_POST['seobooster_dynamic_tagging_related'] ) ) {
    63         update_option( 'seobooster_dynamic_tagging_related', esc_attr( $_POST['seobooster_dynamic_tagging_related'] ) );
     64        update_option( 'seobooster_dynamic_tagging_related', sanitize_key( $_POST['seobooster_dynamic_tagging_related'] ) );
    6465    } else {
    6566        delete_option( 'seobooster_dynamic_tagging_related' );
     
    6869
    6970    if ( isset( $_POST['seobooster_ignore_internal_searches'] ) ) {
    70         update_option( 'seobooster_ignore_internal_searches', esc_attr( $_POST['seobooster_ignore_internal_searches'] ) );
     71        update_option( 'seobooster_ignore_internal_searches', sanitize_key( $_POST['seobooster_ignore_internal_searches'] ) );
    7172    } else {
    7273        delete_option( 'seobooster_ignore_internal_searches' );
     
    7576
    7677    if ( isset( $_POST['seobooster_delete_deactivate'] ) ) {
    77         update_option( 'seobooster_delete_deactivate', esc_attr( $_POST['seobooster_delete_deactivate'] ) );
     78        update_option( 'seobooster_delete_deactivate', sanitize_key( $_POST['seobooster_delete_deactivate'] ) );
    7879    } else {
    7980        delete_option( 'seobooster_delete_deactivate' );
     
    8283
    8384    if ( isset( $_POST['seobooster_dynamic_tagging'] ) ) {
    84         update_option( 'seobooster_dynamic_tagging', esc_attr( $_POST['seobooster_dynamic_tagging'] ) );
     85        update_option( 'seobooster_dynamic_tagging', sanitize_key( $_POST['seobooster_dynamic_tagging'] ) );
    8586    } else {
    8687        delete_option( 'seobooster_dynamic_tagging' );
     
    8990
    9091    if ( isset( $_POST['seobooster_dynamic_tag_assigncpts'] ) ) {
    91         update_option( 'seobooster_dynamic_tag_assigncpts', esc_attr( $_POST['seobooster_dynamic_tag_assigncpts'] ) );
     92        update_option( 'seobooster_dynamic_tag_assigncpts', sanitize_key( $_POST['seobooster_dynamic_tag_assigncpts'] ) );
    9293    } else {
    9394        delete_option( 'seobooster_dynamic_tag_assigncpts' );
     
    9697
    9798    if ( isset( $_POST['seobooster_weekly_email'] ) ) {
    98         update_option( 'seobooster_weekly_email', esc_attr( $_POST['seobooster_weekly_email'] ) );
     99        update_option( 'seobooster_weekly_email', sanitize_text_field( $_POST['seobooster_weekly_email'] ) );
    99100    } else {
    100101        delete_option( 'seobooster_weekly_email' );
     
    103104
    104105    if ( isset( $_POST['seobooster_weekly_email_recipient'] ) ) {
    105         update_option( 'seobooster_weekly_email_recipient', esc_attr( $_POST['seobooster_weekly_email_recipient'] ) );
     106        update_option( 'seobooster_weekly_email_recipient', sanitize_text_field( $_POST['seobooster_weekly_email_recipient'] ) );
    106107    } else {
    107108        delete_option( 'seobooster_weekly_email_recipient' );
     
    110111
    111112    if ( isset( $_POST['seobooster_debug_logging'] ) ) {
    112         update_option( 'seobooster_debug_logging', esc_attr( $_POST['seobooster_debug_logging'] ) );
     113        update_option( 'seobooster_debug_logging', sanitize_text_field( $_POST['seobooster_debug_logging'] ) );
    113114    } else {
    114115        delete_option( 'seobooster_debug_logging' );
     
    117118
    118119    if ( isset( $_POST['seobooster_fof_monitoring'] ) ) {
    119         update_option( 'seobooster_fof_monitoring', esc_attr( $_POST['seobooster_fof_monitoring'] ) );
     120        update_option( 'seobooster_fof_monitoring', sanitize_text_field( $_POST['seobooster_fof_monitoring'] ) );
    120121    } else {
    121122        delete_option( 'seobooster_fof_monitoring' );
     
    123124
    124125    if ( isset( $_POST['seobooster_backlinks_ignore'] ) ) {
    125         update_option( 'seobooster_backlinks_ignore', esc_attr( stripslashes( $_POST['seobooster_backlinks_ignore'] ) ) );
     126        update_option( 'seobooster_backlinks_ignore', sanitize_textarea_field( $_POST['seobooster_backlinks_ignore'] ) );
    126127    }
    127128    if ( isset( $_POST['seobooster_ignorelist'] ) ) {
    128         update_option( 'seobooster_ignorelist', esc_attr( stripslashes( $_POST['seobooster_ignorelist'] ) ) );
     129        update_option( 'seobooster_ignorelist', sanitize_text_field( $_POST['seobooster_ignorelist'] ) );
    129130    }
    130131    if ( isset( $_POST['seobooster_fof_ignore'] ) ) {
    131         update_option( 'seobooster_fof_ignore', esc_attr( stripslashes( $_POST['seobooster_fof_ignore'] ) ) );
     132        update_option( 'seobooster_fof_ignore', sanitize_text_field( $_POST['seobooster_fof_ignore'] ) );
    132133    }
    133134    // WooCommerce
    134135
    135136    if ( isset( $_POST['seobooster_woocommerce'] ) ) {
    136         update_option( 'seobooster_woocommerce', esc_attr( $_POST['seobooster_woocommerce'] ) );
     137        update_option( 'seobooster_woocommerce', sanitize_text_field( $_POST['seobooster_woocommerce'] ) );
    137138    } else {
    138139        delete_option( 'seobooster_woocommerce' );
     
    140141}
    141142
    142 // TODO - CHECK NONCE
    143 
     143
     144// Trimming old keywords
    144145if ( isset( $_POST['delete_old_kws'] ) && $_POST['delete_old_kws'] ) {
    145146    $oldkws = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}sb2_kw WHERE lastvisit < DATE_SUB(NOW(), INTERVAL 90 DAY) LIMIT 10000;" );
    146147    if ( $oldkws ) {
    147148        foreach ( $oldkws as $oldkw ) {
    148             $query = "DELETE FROM {$wpdb->prefix}sb2_kw where id=" . $oldkw->id . ' LIMIT 1;';
    149             $wpdb->query( $query );
     149            $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}sb2_kw where id=%d LIMIT 1;", $oldkw->id ) );
    150150        }
    151151    }
    152152}
    153153
    154 // TODO - CHECK NONCE
    155 
     154// Running DB updates
    156155if ( isset( $_POST['submit_dbupdates'] ) && $_POST['submit_dbupdates'] ) {
    157156    // start migrate old data process..
     
    162161
    163162// Resets and starts the guided tour again.
    164 
    165163if ( isset( $_POST['reset_guided_tours'] ) && $_POST['reset_guided_tours'] ) {
    166164    $pointer   = 'sbp_tour_pointer';
     
    193191$fof_monitoring                    = get_option( 'seobooster_fof_monitoring' );
    194192$seobooster_delete_deactivate      = get_option( 'seobooster_delete_deactivate' );
     193
    195194$seobooster_backlinks_ignore       = get_option( 'seobooster_backlinks_ignore' );
    196195$seobooster_backlinks_ignore       = preg_replace( '/,+/', ',', $seobooster_backlinks_ignore );
    197196$seobooster_backlinks_ignore       = strtolower( $seobooster_backlinks_ignore );
     197
    198198$ignorelist                        = get_option( 'seobooster_ignorelist' );
    199 $ignorelist                        = preg_replace( "/\r|\n/", ',', $ignorelist );
     199//$ignorelist                        = preg_replace( "/\r|\n/", ',', $ignorelist );
    200200$ignorelist                        = preg_replace( '/,+/', ',', $ignorelist );
    201201$ignorelist                        = strtolower( $ignorelist );
     202
    202203$seobooster_fof_ignore             = get_option( 'seobooster_fof_ignore' );
    203 $seobooster_fof_ignore             = preg_replace( "/\r|\n/", ',', $seobooster_fof_ignore );
     204//$seobooster_fof_ignore             = preg_replace( "/\r|\n/", ',', $seobooster_fof_ignore );
    204205$seobooster_fof_ignore             = preg_replace( '/,+/', ',', $seobooster_fof_ignore );
    205206$seobooster_fof_ignore             = strtolower( $seobooster_fof_ignore );
     
    244245</th>
    245246<td>
    246 <textarea id="seobooster_ignorelist" name="seobooster_ignorelist" class="large-text code">
    247 <?php
    248 echo esc_textarea( $ignorelist );
    249 ?>
    250 </textarea>
     247<textarea id="seobooster_ignorelist" name="seobooster_ignorelist" class="large-text code"><?php echo sanitize_textarea_field( $ignorelist ); ?></textarea>
    251248<p class="description">
    252249<?php
     
    430427        'and'
    431428    );
    432     $taxonomies        = array_merge( $builtintaxonomies, $customtaxonomies );
     429    $taxonomies = array_merge( $builtintaxonomies, $customtaxonomies );
    433430    ?>
    434431    <select name="seobooster_dynamic_tag_taxonomy" id="seobooster_dynamic_tag_taxonomy">
     
    436433    if ( $taxonomies ) {
    437434        foreach ( $taxonomies as $name => $atax ) {
    438             echo "<option name='{$name}' value='" . esc_attr( $name ) . "'";
     435            echo "<option name='" . esc_attr( $name) . "' value ='" . esc_attr( $name ) . "'";
    439436            if ( $dynamic_tag_tax === $name ) {
    440437                echo " selected='selected' ";
     
    445442    ?>
    446443    </select>
    447    
    448    
    449444    <p class="description">
    450445    <?php
     
    503498    : <strong>
    504499<?php
    505 echo $cptlist;
     500echo esc_html( $cptlist );
    506501?>
    507502</strong>.</p>
     
    531526    ?>
    532527    </p>
    533    
    534528    </td>
    535529    </tr>
    536    
    537530    </tr>
    538531    <tr valign="top" class="taggingrelated
     
    581574    </td>
    582575    </tr>
    583    
    584    
    585    
    586576    <tr valign="top" id="autolinks">
    587577    <th colspan="2">
     
    593583    </th>
    594584    </tr>
    595    
    596585    <tr valign="top">
    597586    <th scope="row" valign="top">
     
    624613    </td>
    625614    </tr>
    626    
    627    
    628615    <tr valign="top">
    629616    <th scope="row" valign="top">
     
    656643    </td>
    657644    </tr>
    658    
    659    
    660645    <tr valign="top">
    661646    <th scope="row" valign="top">
     
    677662    </td>
    678663    </tr>
    679    
    680664    <?php
    681665    // premium only
     
    695679        />
    696680        <p class="description">Enables keywords to links in WooCommerce product descriptions.</a></p>
    697            
    698             </label>
    699             </fieldset>
    700             </td>
    701             </tr>                   
    702 
    703                    
    704                     <tr valign="top">
    705                     <th colspan="2">
    706                     <h2>
    707                     <?php
    708                     esc_html_e( 'Weekly Email Reports', 'seo-booster' );
    709                     ?>
    710                     </h2>
    711                                         </th>
    712                     </tr>
    713                     <tr valign="top">
    714                     <th scope="row" valign="top">
    715                     <?php
    716                     esc_html_e( 'Enable/Disable', 'seo-booster' );
    717                     ?>
    718                     </th>
    719                     <td>
    720                     <input type="checkbox" id="seobooster_weekly_email" name="seobooster_weekly_email" value="on"
    721                     <?php
    722                     if ( 'on' === $seobooster_weekly_email ) {
    723                         echo " checked='checked'";
    724                     }
    725                     ?>
    726                         />
    727                         <p class="description"><label for="seobooster_weekly_email">
    728                         <?php
    729                         esc_html_e( 'Send a weekly email with information of keyword stats, new backlinks and 404 errors detected the past week.', 'seo-booster' );
    730                         ?>
    731                         </label></p>
    732                        
    733                         </td>
    734                         </tr>
    735                        
    736                         <tr valign="top">
    737                         <th scope="row" valign="top">
    738                         <?php
    739                         esc_html_e( 'Email recipient', 'seo-booster' );
    740                         ?>
    741                         </th>
    742                         <td>
    743                         <input type="text" id="seobooster_weekly_email_recipient" name="seobooster_weekly_email_recipient" value="
    744                         <?php
    745                         echo esc_attr( $seobooster_weekly_email_recipient );
    746                         ?>
    747                         " class="regular-text">
    748                         <p class="description"><label for="seobooster_weekly_email_recipient">
    749                         <?php
    750                         esc_html_e( 'Email recipent.', 'seo-booster' );
    751                         ?>
    752                         </label></p>
    753                         </td>
    754                         </tr>
    755                        
    756                        
    757                         <tr valign="top">
    758                         <th colspan="2">
    759                         <h2>
    760                         <?php
    761                         esc_html_e( '404 Errors', 'seo-booster' );
    762                         ?>
    763                         </h2>
    764                                                 </th>
    765                         </tr>
    766                         <tr valign="top">
    767                         <th scope="row" valign="top">
    768                         <p>
    769                         <?php
    770                         esc_html_e( 'Enable/Disable', 'seo-booster' );
    771                         ?>
    772                         </p>
    773                        
    774                         </th>
    775                         <td>
    776                         <input type="checkbox" id="seobooster_fof_monitoring" name="seobooster_fof_monitoring" value="on"
    777                         <?php
    778                         if ( 'on' === $fof_monitoring ) {
    779                             echo " checked='checked'";
    780                         }
    781                         ?>
    782                         />
    783                         <p class="description"><label for="seobooster_fof_monitoring">
    784                         <?php
    785                         esc_html_e( 'If turned on, 404 errors will be monitored.', 'seo-booster' );
    786                         ?>
    787                         </label></p>
    788                         </td>
    789                         </tr>
    790                        
    791                         <tr valign="top">
    792                         <th scope="row" valign="top">
    793                         <?php
    794                         esc_html_e( 'Ignore links', 'seo-booster' );
    795                         ?>
    796                         </th>
    797                         <td>
    798                         <textarea id="seobooster_fof_ignore" name="seobooster_fof_ignore" class="large-text code">
    799                         <?php
    800                         echo esc_textarea( $seobooster_fof_ignore );
    801                         ?>
    802                         </textarea>
    803                         <p class="description">
    804                         <?php
    805                         esc_html_e( 'Here you can instruct the plugin to ignore 404 errors on URLs that match.', 'seo-booster' );
    806                         ?>
    807                         </p>
    808                         <p class="description">
    809                         <?php
    810                         esc_html_e( 'For example if you want to ignore 404 errors URLs with', 'seo-booster' );
    811                         ?>
    812                          <code>well-known.tar.gz</code> or <code>.php.suspected</code></p>
    813                        
    814                         <p class="description">
    815                         <?php
    816                         esc_html_e( 'Separate with a comma or linebreak.', 'seo-booster' );
    817                         ?>
    818                         </p>
    819                         </td>
    820                         </tr>
    821                        
    822                        
    823                        
    824                        
    825                        
    826                        
    827                        
    828                        
    829                         <tr valign="top">
    830                         <th colspan="2">
    831                         <h2>
    832                         <?php
    833                         esc_html_e( 'Debug Logging', 'seo-booster' );
    834                         ?>
    835                         </h2>
    836                         </th>
    837                         </tr>
    838                         <tr valign="top">
    839                         <th scope="row" valign="top">
    840                         <p>
    841                         <?php
    842                         esc_html_e( 'Enable/Disable', 'seo-booster' );
    843                         ?>
    844                         </p>
    845                        
    846                         </th>
    847                         <td>
    848                         <input type="checkbox" id="seobooster_debug_logging" name="seobooster_debug_logging" value="on"
    849                         <?php
    850                         if ( 'on' === $debug_logging ) {
    851                             echo " checked='checked'";
    852                         }
    853                         ?>
    854                         />
    855                         <p class="description"><label for="seobooster_debug_logging">
    856                         <?php
    857                         esc_html_e( 'If turned on, the log will have debug information that can be helpful for finding errors or configuration issues.', 'seo-booster' );
    858                         ?>
    859                         </label></p>
    860                         </td>
    861                         </tr>
    862                        
    863                        
    864                        
    865                        
    866                        
    867                        
    868                        
    869                        
    870                        
    871                        
    872                        
    873                        
    874                        
    875                        
    876                         <?php
    877                         // premium only
    878                         ?>
    879                            
    880                             <tr valign="top">
    881                             <th colspan="2">
    882                             <hr>
     681        </label>
     682        </fieldset>
     683        </td>
     684        </tr>                   
     685        <tr valign="top">
     686        <th colspan="2">
     687        <h2>
     688        <?php
     689        esc_html_e( 'Weekly Email Reports', 'seo-booster' );
     690        ?>
     691        </h2>
    883692                            </th>
    884                             </tr>
    885                             <tr valign="top">
    886                             <th scope="row" valign="top">
    887                             <?php
    888                             esc_html_e( 'Delete data on deactivate:', 'seo-booster' );
    889                             ?>
    890                             </th>
    891                             <td>
    892                             <input type="checkbox" id="seobooster_delete_deactivate" name="seobooster_delete_deactivate" value="on"
    893                             <?php
    894                             if ( 'on' === $seobooster_delete_deactivate ) {
    895                                 echo " checked='checked'";
    896                             }
    897                             ?>
    898                             />
    899                             <p class="description"><label for="seobooster_delete_deactivate">
    900                             <?php
    901                             esc_html_e( 'Turn this on to delete all data when deactivating the plugin. This cannot be undone.', 'seo-booster' );
    902                             ?>
    903                             </label></p>
    904                            
    905                             <p class="description">
    906                             <?php
    907                             esc_html_e( 'WordPress Multisite users: Careful! Turning this on and deactivating the plugin deletes ALL SEO Booster database tables on ALL sites.', 'seo-booster' );
    908                             ?>
    909                             </p>
    910                             </td>
    911                             </tr>
    912                            
    913                            
    914                             <tr>
    915                             <td colspan="2">
    916                             <input type="hidden" name="page" value="sb2_settings">
    917                             <?php
    918                             wp_nonce_field( 'seobooster_save_settings' );
    919                             ?>
    920                             <?php
    921                             submit_button();
    922                             ?>
    923                             </td>
    924                             </tr>
    925                             </tbody>
    926                             </table>
    927                             </form>
    928                            
    929                             <hr>
    930                            
    931                             <h3>
    932                             <?php
    933                             esc_html_e( 'Tools', 'seo-booster' );
    934                             ?>
    935                             </h3>
    936                             <form method="post">
    937                             <?php
    938                             wp_nonce_field( 'seobooster_do_actions' );
    939                             ?>
    940                             <table class="form-table">
    941                             <tbody>
    942                             <tr valign="top">
    943                             <th scope="row" valign="top">
    944                             <?php
    945                             esc_html_e( 'Database Update', 'seo-booster' );
    946                             ?>
    947                             </th>
    948                             <td>
    949                             <?php
    950                             submit_button( __( 'Run Update Database', 'seo-booster' ), 'secondary', 'submit_dbupdates' );
    951                             ?>
    952                             <label class="description" for="submit">
    953                             <?php
    954                             esc_html_e( 'If you need to manually run the database updates. No need to use unless directed by support.', 'seo-booster' );
    955                             ?>
    956                             </label>
    957                             </td>
    958                             </tr>
    959                            
    960                             <tr valign="top">
    961                             <th scope="row" valign="top">
    962                             <?php
    963                             esc_html_e( 'Guided Tour', 'seo-booster' );
    964                             ?>
    965                             </th>
    966                             <td>
    967                             <?php
    968                             submit_button( __( 'See Guided Tour', 'seo-booster' ), 'secondary', 'reset_guided_tours' );
    969                             ?>
    970                                                         <p class="description" for="reset_guided_tours">
    971                             <?php
    972                             esc_html_e( 'Click to start the Guided Tour again.', 'seo-booster' );
    973                             ?>
    974                             </p>
    975                             </td>
    976                             </tr>
    977                             <tr valign="top">
    978                             <th scope="row" valign="top">
    979                             <?php
    980                             esc_html_e( 'Account Reset', 'seo-booster' );
    981                             ?>
    982                             </th>
    983                             <td>
    984                             <a href="
    985                             <?php
    986                             echo esc_url( $seobooster_fs->get_reconnect_url() );
    987                             ?>
    988                             ">
    989 <?php
    990 esc_html_e( 'Click to Reset', 'seo-booster' );
    991 ?>
    992 </a>
    993                             <p class="description" for="reset_account_details">
    994                             <?php
    995                             esc_html_e( 'Click to reset and start registration process again.', 'seo-booster' );
    996                             ?>
    997                             </p>
    998                             </td>
    999                             </tr>
    1000                             </tbody>
    1001                             </table>
    1002                             </form>
    1003                             </div>
    1004                            
     693        </tr>
     694        <tr valign="top">
     695        <th scope="row" valign="top">
     696        <?php
     697        esc_html_e( 'Enable/Disable', 'seo-booster' );
     698        ?>
     699        </th>
     700        <td>
     701        <input type="checkbox" id="seobooster_weekly_email" name="seobooster_weekly_email" value="on"
     702        <?php
     703        if ( 'on' === $seobooster_weekly_email ) {
     704            echo " checked='checked'";
     705        }
     706        ?>
     707        />
     708        <p class="description"><label for="seobooster_weekly_email">
     709        <?php
     710        esc_html_e( 'Send a weekly email with information of keyword stats, new backlinks and 404 errors detected the past week.', 'seo-booster' );
     711        ?>
     712        </label></p>
     713        </td>
     714        </tr>
     715        <tr valign="top">
     716        <th scope="row" valign="top">
     717        <?php
     718        esc_html_e( 'Email recipient', 'seo-booster' );
     719        ?>
     720        </th>
     721        <td>
     722        <input type="text" id="seobooster_weekly_email_recipient" name="seobooster_weekly_email_recipient" value="
     723        <?php
     724        echo esc_attr( $seobooster_weekly_email_recipient );
     725        ?>
     726        " class="regular-text">
     727        <p class="description"><label for="seobooster_weekly_email_recipient">
     728        <?php
     729        esc_html_e( 'Email recipent.', 'seo-booster' );
     730        ?>
     731        </label></p>
     732        </td>
     733        </tr>
     734        <tr valign="top">
     735        <th colspan="2">
     736        <h2>
     737        <?php
     738        esc_html_e( '404 Errors', 'seo-booster' );
     739        ?>
     740        </h2>
     741                                </th>
     742        </tr>
     743        <tr valign="top">
     744        <th scope="row" valign="top">
     745        <p>
     746        <?php
     747        esc_html_e( 'Enable/Disable', 'seo-booster' );
     748        ?>
     749        </p>
     750        </th>
     751        <td>
     752        <input type="checkbox" id="seobooster_fof_monitoring" name="seobooster_fof_monitoring" value="on"
     753        <?php
     754        if ( 'on' === $fof_monitoring ) {
     755            echo " checked='checked'";
     756        }
     757        ?>
     758        />
     759        <p class="description"><label for="seobooster_fof_monitoring">
     760        <?php
     761        esc_html_e( 'If turned on, 404 errors will be monitored.', 'seo-booster' );
     762        ?>
     763        </label></p>
     764        </td>
     765        </tr>
     766        <tr valign="top">
     767        <th scope="row" valign="top">
     768        <?php
     769        esc_html_e( 'Ignore links', 'seo-booster' );
     770        ?>
     771        </th>
     772        <td>
     773        <textarea id="seobooster_fof_ignore" name="seobooster_fof_ignore" class="large-text code"><?php echo sanitize_textarea_field( $seobooster_fof_ignore ); ?></textarea>
     774        <p class="description">
     775        <?php
     776        esc_html_e( 'Here you can instruct the plugin to ignore 404 errors on URLs that match.', 'seo-booster' );
     777        ?>
     778        </p>
     779        <p class="description">
     780        <?php
     781        esc_html_e( 'For example if you want to ignore 404 errors URLs with', 'seo-booster' );
     782        ?>
     783            <code>well-known.tar.gz</code> or <code>.php.suspected</code></p>
     784       
     785        <p class="description">
     786        <?php
     787        esc_html_e( 'Separate with a comma or linebreak.', 'seo-booster' );
     788        ?>
     789        </p>
     790        </td>
     791        </tr>
     792        <tr valign="top">
     793        <th colspan="2">
     794        <h2>
     795        <?php
     796        esc_html_e( 'Debug Logging', 'seo-booster' );
     797        ?>
     798        </h2>
     799        </th>
     800        </tr>
     801        <tr valign="top">
     802        <th scope="row" valign="top">
     803        <p>
     804        <?php
     805        esc_html_e( 'Enable/Disable', 'seo-booster' );
     806        ?>
     807        </p>
     808        </th>
     809        <td>
     810        <input type="checkbox" id="seobooster_debug_logging" name="seobooster_debug_logging" value="on"
     811        <?php
     812        if ( 'on' === $debug_logging ) {
     813            echo " checked='checked'";
     814        }
     815        ?>
     816        />
     817        <p class="description"><label for="seobooster_debug_logging">
     818        <?php
     819        esc_html_e( 'If turned on, the log will have debug information that can be helpful for finding errors or configuration issues.', 'seo-booster' );
     820        ?>
     821        </label></p>
     822        </td>
     823        </tr>
     824        <?php
     825        // premium only
     826        ?>
     827        <tr valign="top">
     828        <th colspan="2">
     829        <hr>
     830        </th>
     831        </tr>
     832        <tr valign="top">
     833        <th scope="row" valign="top">
     834        <?php
     835        esc_html_e( 'Delete data on deactivate:', 'seo-booster' );
     836        ?>
     837        </th>
     838        <td>
     839        <input type="checkbox" id="seobooster_delete_deactivate" name="seobooster_delete_deactivate" value="on"
     840        <?php
     841        if ( 'on' === $seobooster_delete_deactivate ) {
     842            echo " checked='checked'";
     843        }
     844        ?>
     845        />
     846        <p class="description"><label for="seobooster_delete_deactivate">
     847        <?php
     848        esc_html_e( 'Turn this on to delete all data when deactivating the plugin. This cannot be undone.', 'seo-booster' );
     849        ?>
     850        </label></p>
     851        <p class="description">
     852        <?php
     853        esc_html_e( 'WordPress Multisite users: Careful! Turning this on and deactivating the plugin deletes ALL SEO Booster database tables on ALL sites.', 'seo-booster' );
     854        ?>
     855        </p>
     856        </td>
     857        </tr>
     858        <tr>
     859        <td colspan="2">
     860        <input type="hidden" name="page" value="sb2_settings">
     861
     862        <?php
     863        submit_button();
     864        ?>
     865        </td>
     866        </tr>
     867        </tbody>
     868        </table>
     869        <?php
     870        wp_nonce_field( 'seobooster_save_settings' );
     871        ?>
     872        </form>
     873        <hr>
     874        <h3>
     875        <?php
     876        esc_html_e( 'Tools', 'seo-booster' );
     877        ?>
     878        </h3>
     879        <form method="post">
     880        <?php
     881        wp_nonce_field( 'seobooster_do_actions' );
     882        ?>
     883        <table class="form-table">
     884        <tbody>
     885        <tr valign="top">
     886        <th scope="row" valign="top">
     887        <?php
     888        esc_html_e( 'Database Update', 'seo-booster' );
     889        ?>
     890        </th>
     891        <td>
     892        <?php
     893        submit_button( __( 'Run Update Database', 'seo-booster' ), 'secondary', 'submit_dbupdates' );
     894        ?>
     895        <label class="description" for="submit">
     896        <?php
     897        esc_html_e( 'If you need to manually run the database updates. No need to use unless directed by support.', 'seo-booster' );
     898        ?>
     899        </label>
     900        </td>
     901        </tr>
     902       
     903        <tr valign="top">
     904        <th scope="row" valign="top">
     905        <?php
     906        esc_html_e( 'Guided Tour', 'seo-booster' );
     907        ?>
     908        </th>
     909        <td>
     910        <?php
     911        submit_button( __( 'See Guided Tour', 'seo-booster' ), 'secondary', 'reset_guided_tours' );
     912        ?>
     913                                    <p class="description" for="reset_guided_tours">
     914        <?php
     915        esc_html_e( 'Click to start the Guided Tour again.', 'seo-booster' );
     916        ?>
     917        </p>
     918        </td>
     919        </tr>
     920        <tr valign="top">
     921        <th scope="row" valign="top">
     922        <?php
     923        esc_html_e( 'Account Reset', 'seo-booster' );
     924        ?>
     925        </th>
     926        <td>
     927        <a href="<?php echo esc_url( $seobooster_fs->get_reconnect_url() ); ?>">
     928        <?php
     929        esc_html_e( 'Click to Reset', 'seo-booster' );
     930        ?>
     931        </a>
     932        <p class="description" for="reset_account_details">
     933        <?php
     934        esc_html_e( 'Click to reset and start registration process again.', 'seo-booster' );
     935        ?>
     936        </p>
     937        </td>
     938        </tr>
     939        </tbody>
     940        </table>
     941        </form>
     942        </div>
  • seo-booster/trunk/seo-booster.php

    r2637115 r2644211  
    33/**
    44* Plugin Name: SEO Booster
    5 * Version: 3.8
     5* Version: 3.8.1
    66* Plugin URI: https://cleverplugins.com/
    77* Description: Automatic linking + Monitor keywords from hundreds of search engines + 404 errors tracking + backlink collecting + Crosslinking widgets and template functions + much more.
     
    7373}
    7474
    75 define( 'SEOBOOSTER_VERSION', '3.7' );
     75define( 'SEOBOOSTER_VERSION', '3.8.1' );
    7676define( 'SEOBOOSTER_PLUGINPATH', plugin_dir_path( __FILE__ ) );
    7777define( 'SEOBOOSTER_PLUGINURL', plugin_dir_url( __FILE__ ) );
     
    216216            // Choice selected by user.
    217217            // Verify nonce.
     218            error_log( 'seobooster_fs_opt_in() ' . print_r( $nonce, true ) . ' ' . print_r( $choice, true ) );
    218219           
    219220            if ( empty($nonce) || !wp_verify_nonce( $nonce, 'seobooster-freemius-opt' ) ) {
     
    455456                            </a>
    456457                    </p>
    457                     <input type="hidden" id="seobooster-freemius-opt-nonce" value="
    458                             <?php
     458                    <input type="hidden" id="seobooster-freemius-opt-nonce" value="<?php
    459459                            echo  esc_attr( wp_create_nonce( 'seobooster-freemius-opt' ) ) ;
    460                             ?>
    461                             " />
    462 
     460                            ?>" />
    463461                </div>
    464462                            <?php
     
    579577            check_ajax_referer( 'add-keyword-nonce', 'add-keyword-nonce', true );
    580578            global  $wpdb ;
    581             $keyword = esc_attr( $_POST['newkeyword'] );
    582             //todo sanitize ssss
    583             $targeturl = esc_attr( $_POST['targeturl'] );
    584             //todo sanitize ssss
     579            $keyword = sanitize_text_field( $_POST['newkeyword'] );
     580            $targeturl = sanitize_text_field( $_POST['targeturl'] );
    585581            $keyword_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}sb2_autolink WHERE keyword = %s", $keyword ) );
    586582            if ( $keyword_id ) {
     
    591587            }
    592588            // Check URL is valid
    593             if ( filter_var( $_POST['targeturl'], FILTER_VALIDATE_URL ) === false ) {
     589            if ( filter_var( sanitize_text_field( $_POST['targeturl'] ), FILTER_VALIDATE_URL ) === false ) {
    594590                wp_send_json( array(
    595                     'answer' => sprintf( __( 'Error - <code>%s</code> is not a valid URL.', 'seo-booster' ), esc_attr( $_POST['targeturl'] ) ),
     591                    'answer' => sprintf( __( 'Error - <code>%s</code> is not a valid URL.', 'seo-booster' ), esc_attr( sanitize_text_field( $_POST['targeturl'] ) ) ),
    596592                    'error'  => 'malurl',
    597593                ) );
     
    601597            if ( $keyword && $targeturl ) {
    602598                $wpdb->insert( "{$wpdb->prefix}sb2_autolink", array(
    603                     'keyword' => $_POST['newkeyword'],
    604                     'url'     => $_POST['targeturl'],
     599                    'keyword' => sanitize_text_field( $_POST['newkeyword'] ),
     600                    'url'     => sanitize_text_field( $_POST['targeturl'] ),
    605601                ), array( '%s', '%s' ) );
    606602                $last_insert_id = $wpdb->insert_id;
    607603               
    608604                if ( $last_insert_id ) {
    609                     $newrow = '<tr><th scope="row" class="check-column"><input type="checkbox" name="alid[]" value="' . $last_insert_id . '"></th><td class="keyword column-keyword has-row-actions column-primary" data-colname="' . __( 'Keyword', 'seo-booster' ) . '">' . $keyword . '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details', 'seo-booster' ) . '</span></button></td><td class="pointing column-pointing" data-colname=""><span class="dashicons dashicons-arrow-right-alt"></span></td><td class="url column-url" data-colname="' . __( 'Target URL', 'seo-booster' ) . '"><a href="' . $targeturl . '" target="_blank">' . $targeturl . '</a></td></tr>';
     605                    $newrow = '<tr><th scope="row" class="check-column"><input type="checkbox" name="alid[]" value="' . esc_attr( $last_insert_id ) . '"></th><td class="keyword column-keyword has-row-actions column-primary" data-colname="' . __( 'Keyword', 'seo-booster' ) . '">' . esc_html( $keyword ) . '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details', 'seo-booster' ) . '</span></button></td><td class="pointing column-pointing" data-colname=""><span class="dashicons dashicons-arrow-right-alt"></span></td><td class="url column-url" data-colname="' . __( 'Target URL', 'seo-booster' ) . '"><a href="' . esc_url( $targeturl ) . '" target="_blank">' . esc_url( $targeturl ) . '</a></td></tr>';
    610606                    wp_send_json( array(
    611607                        'newrow'  => $newrow,
     
    621617        }
    622618       
     619        /**
     620         * do_custom_meta.
     621         *
     622         * @author  Unknown
     623         * @since   v0.0.1
     624         * @version v1.0.0  Tuesday, November 30th, 2021.
     625         * @access  public static
     626         * @return  void
     627         */
    623628        public static function do_custom_meta()
    624629        {
     
    633638                array( __CLASS__, 'sbp_meta_callback' ),
    634639                $post_types,
    635                 // screen  @todo get list of public post types
    636                 $context = 'side',
    637                 $priority = 'default',
    638                 $callback_args = null
     640                'side',
     641                'default',
     642                null
    639643            );
    640644        }
    641645       
     646        /**
     647         * sbp_meta_callback.
     648         *
     649         * @author  Unknown
     650         * @since   v0.0.1
     651         * @version v1.0.0  Tuesday, November 30th, 2021.
     652         * @access  public static
     653         * @param   mixed   $post   
     654         * @return  void
     655         */
    642656        public static function sbp_meta_callback( $post )
    643657        {
     
    668682            }
    669683            ?>
    670                         />
    671                         <?php
     684                    />
     685                    <?php
    672686            esc_html_e( 'Change keywords on this page to links.', 'seo-booster' );
    673687            ?>
     
    686700                        <?php
    687701                echo  esc_url( $autolink_url ) ;
    688                 ?>
    689                 " target="_blank">Autolink</a></small>
     702                ?>" target="_blank">Autolink</a></small>
    690703                        <?php
    691704            }
     
    714727                checked( $appendkeywords, 'yes' );
    715728            }
    716             ?>
    717                             />
     729            ?>/>
    718730                            <?php
    719731            esc_html_e( 'Append the list of popular keywords to this page.', 'seo-booster' );
     
    735747            $is_autosave = wp_is_post_autosave( $post_id );
    736748            $is_revision = wp_is_post_revision( $post_id );
    737             $is_valid_nonce = ( isset( $_POST['sbp_nonce'] ) && wp_verify_nonce( $_POST['sbp_nonce'], basename( __FILE__ ) ) ? 'true' : 'false' );
     749            $is_valid_nonce = ( isset( $_POST['sbp_nonce'] ) && wp_verify_nonce( sanitize_text_field( $_POST['sbp_nonce'] ), basename( __FILE__ ) ) ? 'true' : 'false' );
    738750            // Exits script depending on save status
    739751            if ( $is_autosave || $is_revision || !$is_valid_nonce ) {
     
    768780        }
    769781       
    770         // @lars - bruges stadig? kan ikke s referencer i kode?
    771782        /**
    772783         * Find a word in a string
    773784         * Ref https://stackoverflow.com/questions/4366730/how-do-i-check-if-a-string-contains-a-specific-word
    774          * @param  string $str String to search in
    775          * @param  string $word Word to look for
    776          * @return array
     785         *
     786         * @author  Unknown
     787         * @since   v0.0.1
     788         * @version v1.0.0  Tuesday, November 30th, 2021.
     789         * @access  public static
     790         * @param   mixed   $str    String to search in
     791         * @param   mixed   $word   Word to look for
     792         * @return  mixed
    777793         */
    778794        public static function contains_word( $str, $word )
     
    787803        }
    788804       
    789         // from shkspr.mobi - https://shkspr.mobi/blog/2012/09/a-utf-8-aware-substr_replace-for-use-in-app-net/
     805        /**
     806         * from shkspr.mobi - https://shkspr.mobi/blog/2012/09/a-utf-8-aware-substr_replace-for-use-in-app-net/
     807         *
     808         * @var     public  stati
     809         */
    790810        public static function utf8_substr_replace(
    791811            $original,
     
    813833        /**
    814834         * Checks a string against an array of keywords and returns any matches or false if no match.
     835         *
     836         * @author  Unknown
     837         * @since   v0.0.1
     838         * @version v1.0.0  Tuesday, November 30th, 2021.
     839         * @access  public static
     840         * @param   mixed   $str   
     841         * @param   array   $arr   
     842         * @return  boolean
    815843         */
    816844        public static function array_in_string( $str, array $arr )
     
    833861        }
    834862       
     863        /**
     864         * do_filter_the_content.
     865         *
     866         * @author  Unknown
     867         * @since   v0.0.1
     868         * @version v1.0.0  Tuesday, November 30th, 2021.
     869         * @access  public static
     870         * @param   mixed   $content   
     871         * @param   boolean $forced     Default: false
     872         * @return  mixed
     873         */
    835874        public static function do_filter_the_content( $content, $forced = false )
    836875        {
     
    10721111        /**
    10731112         * Returns icon in SVG format
    1074          *
    10751113         * Thanks Yoast for example code.
    10761114         *
    1077          * @param type|bool $base64  Default true - returns content base64 encoded
    1078          * @return string
     1115         * @author  Unknown
     1116         * @since   v0.0.1
     1117         * @version v1.0.0  Tuesday, November 30th, 2021.
     1118         * @access  public static
     1119         * @param   boolean $base64 Default: true
     1120         * @return  mixed
    10791121         */
    10801122        public static function get_icon_svg( $base64 = true )
     
    11851227        }
    11861228       
    1187         // Runs on action "template_redirect" - 404
     1229        /**
     1230         * Runs on action "template_redirect" - 404
     1231         *
     1232         * @author  Unknown
     1233         * @since   v0.0.1
     1234         * @version v1.0.0  Tuesday, November 30th, 2021.
     1235         * @access  public static
     1236         * @return  void
     1237         */
    11881238        public static function template_redirect_action()
    11891239        {
    11901240            if ( empty($_POST) && defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) || defined( 'XMLRPC_REQUEST' ) || defined( 'DOING_AUTOSAVE' ) || defined( 'REST_REQUEST' ) ) {
    1191                 // phpcs:ignore WordPress.Security.NonceVerification.Missing
    11921241                return;
    11931242            }
     
    12431292           
    12441293            if ( isset( $_SERVER['HTTP_REFERER'] ) ) {
    1245                 $parsedurl = wp_parse_url( $_SERVER['HTTP_REFERER'] );
     1294                $parsedurl = wp_parse_url( sanitize_text_field( $_SERVER['HTTP_REFERER'] ) );
    12461295                $domain = $parsedurl['host'];
    12471296            }
     
    12511300               
    12521301                if ( isset( $_SERVER['HTTP_REFERER'] ) ) {
    1253                     $referer = strtolower( $_SERVER['HTTP_REFERER'] );
     1302                    $referer = strtolower( sanitize_text_field( $_SERVER['HTTP_REFERER'] ) );
    12541303                } else {
    12551304                    $referer = '';
     
    13741423       
    13751424        /**
    1376          * When deleting a blog in multisite.
     1425         * When deleting a blog in multisite - returns array of tables to delete
     1426         *
     1427         * @author  Unknown
     1428         * @since   v0.0.1
     1429         * @version v1.0.0  Tuesday, November 30th, 2021.
     1430         * @access  public static
     1431         * @param   mixed   $tables
     1432         * @return  mixed
    13771433         */
    13781434        public static function on_delete_blog( $tables )
    13791435        {
    13801436            global  $wpdb ;
     1437            $tables = array();
    13811438            $tables[] = $wpdb->prefix . 'sb2_crawl';
    13821439            $tables[] = $wpdb->prefix . 'sb2_autolink';
     
    13931450        /**
    13941451         * Turns a relative URL to absolute URL.
     1452         *
     1453         * @author  Unknown
     1454         * @since   v0.0.1
     1455         * @version v1.0.0  Tuesday, November 30th, 2021.
     1456         * @access  public static
     1457         * @param   mixed   $rel   
     1458         * @param   mixed   $base   
     1459         * @return  mixed
    13951460         */
    13961461        public static function rel2abs( $rel, $base )
     
    14331498        }
    14341499       
     1500        /**
     1501         * plugins_loaded_register_visitor.
     1502         *
     1503         * @author  Unknown
     1504         * @since   v0.0.1
     1505         * @version v1.0.0  Tuesday, November 30th, 2021.
     1506         * @access  public static
     1507         * @return  void
     1508         */
    14351509        public static function plugins_loaded_register_visitor()
    14361510        {
     
    14861560        }
    14871561       
     1562        /**
     1563         * send_email_update.
     1564         *
     1565         * @author  Unknown
     1566         * @since   v0.0.1
     1567         * @version v1.0.0  Tuesday, November 30th, 2021.
     1568         * @access  public static
     1569         * @param   integer $days   Default: 7
     1570         * @param   boolean $forced Default: false
     1571         * @return  void
     1572         */
    14881573        public static function send_email_update( $days = 7, $forced = false )
    14891574        {
     
    15571642                );
    15581643                $html = file_get_contents( SEOBOOSTER_PLUGINURL . 'inc/emailtemplate-01.html' );
     1644                // @todo load via filesystem instead
    15591645                foreach ( $my_replacements as $needle => $replacement ) {
    15601646                    $html = str_replace( $needle, $replacement, $html );
     
    16131699        public static function seobooster_generateignorelist( $ignorelist = '' )
    16141700        {
     1701            global  $wpdb ;
    16151702           
    16161703            if ( !$ignorelist ) {
     
    16351722                            $ignoresearchstring .= ' OR ';
    16361723                        }
    1637                         $ignoresearchstring .= " (kw LIKE '%" . $tag . "%') ";
     1724                        $like = '%' . $wpdb->esc_like( $tag ) . '%';
     1725                        $ignoresearchstring .= $wpdb->prepare( " (kw LIKE %s) ", $like );
    16381726                        // REMOVED esc_sc.l
    16391727                        $count++;
     
    16661754            $drawval = 1;
    16671755            if ( isset( $_REQUEST['draw'] ) ) {
    1668                 $drawval = intval( $_REQUEST['draw'] );
     1756                $drawval = sanitize_text_field( $_REQUEST['draw'] );
    16691757            }
    16701758            $a_columns = array(
     
    16841772           
    16851773            if ( isset( $_REQUEST['length'] ) ) {
    1686                 $the_length = intval( $_REQUEST['length'] );
     1774                $the_length = sanitize_text_field( $_REQUEST['length'] );
    16871775                setcookie(
    16881776                    'sbp_kw_length',
    1689                     $the_length,
    1690                     $expiry,
    1691                     $path,
    1692                     $host,
     1777                    esc_attr( $the_length ),
     1778                    esc_attr( $expiry ),
     1779                    esc_url( $path ),
     1780                    esc_attr( $host ),
    16931781                    true,
    16941782                    true
     
    17021790                    'sbp_the_showkws',
    17031791                    esc_attr( $the_showkws ),
    1704                     $expiry,
    1705                     $path,
    1706                     $host,
     1792                    esc_attr( $expiry ),
     1793                    esc_url( $path ),
     1794                    esc_attr( $host ),
    17071795                    true,
    17081796                    true
     
    17161804                    'sbp_kw_hideinternal',
    17171805                    esc_attr( $the_hideinternal ),
    1718                     $expiry,
    1719                     $path,
    1720                     $host,
     1806                    esc_attr( $expiry ),
     1807                    esc_url( $path ),
     1808                    esc_attr( $host ),
    17211809                    true,
    17221810                    true
     
    17271815                    '',
    17281816                    time() - 3600,
    1729                     $path,
    1730                     $host,
     1817                    esc_url( $path ),
     1818                    esc_attr( $host ),
    17311819                    true,
    17321820                    true
     
    18371925            $ifiltered_total = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}sb2_kw {$s_where} " );
    18381926            $itotal = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->prefix}sb2_kw;" );
    1839             // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
    18401927            $output = array(
    18411928                'draw'            => $drawval,
     
    22722359        )
    22732360        {
     2361            $wp_allowed_protocols = wp_allowed_protocols();
    22742362            ?>
    22752363            <script type="text/javascript">
     
    22862374
    22872375                button = jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php
    2288             echo  wp_kses( $button1 ) ;
     2376            echo  wp_kses( $button1, $wp_allowed_protocols ) ;
    22892377            ?>' + '</a>');
    22902378                button.bind ('click.pointer', function () {
     
    23162404
    23172405        jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php
    2318                 echo  $button2 ;
     2406                echo  wp_kses( $button2, $wp_allowed_protocols ) ;
    23192407                ?>' + '</a>');
    23202408        jQuery ('#pointer-primary').click (function () {
     
    24082496            }
    24092497            global  $post, $wpdb ;
    2410             $kwtable = $wpdb->prefix . 'sb2_kw';
    24112498            $sqlignore = self::seobooster_generateignorelist();
    2412             $query = "SELECT DISTINCT(kw) FROM {$wpdb->prefix}sb2_kw WHERE {$sqlignore} lp like '%{$currurl}' AND ig='0' AND kw<>'#'  ORDER BY visits DESC LIMIT {$limit};";
     2499            $query = $wpdb->prepare( "SELECT DISTINCT(kw) FROM {$wpdb->prefix}sb2_kw WHERE {$sqlignore} lp like '%{$currurl}' AND ig='0' AND kw<>'#'  ORDER BY visits DESC LIMIT %d;", $limit );
    24132500            $kws = $wpdb->get_results( $query, ARRAY_A );
    24142501            $kwlist = '';
     
    39134000         * check_page_for_url.
    39144001         *
    3915          * @author  Unknown
    3916          * @since   v0.0.1
    3917          * @version v1.0.0  Saturday, August 7th, 2021.
    3918          * @access  public static
    3919          * @param   mixed   $page_url
    3920          * @param   mixed   $check_url
    3921          * @return  mixed
     4002         * @author  Unknown
     4003         * @since   v0.0.1
     4004         * @version v1.0.0  Saturday, August 7th, 2021.
     4005         * @version v1.0.1  Tuesday, November 30th, 2021.
     4006         * @access  public static
     4007         * @param   mixed   $page_url   
     4008         * @param   mixed   $check_url 
     4009         * @return  mixed
    39224010         */
    39234011        public static function check_page_for_url( $page_url, $check_url )
    39244012        {
    39254013            $result = array();
    3926             // todo - make this check with WP default?
    3927             $ch = curl_init( $page_url );
    3928             curl_setopt( $ch, CURLOPT_HEADER, 0 );
    3929             curl_setopt( $ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; SEO Booster/' . SEOBOOSTER_VERSION . '; +https://cleverplugins.com)' );
    3930             curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 30 );
    3931             curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
    3932             $output = curl_exec( $ch );
    3933             $http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
    3934             curl_close( $ch );
    3935             $result['code'] = $http_code;
     4014            $response = wp_remote_get( $page_url, array(
     4015                'timeout'    => 30,
     4016                'user-agent' => esc_attr( 'Mozilla/5.0 (compatible; SEO Booster Bot v.' . SEOBOOSTER_VERSION . '; +https://cleverplugins.com)' ),
     4017            ) );
     4018            $http_code = wp_remote_retrieve_response_code( $response );
     4019            $output = wp_remote_retrieve_body( $response );
    39364020           
    39374021            if ( 200 === $http_code ) {
     
    39954079        $sqlignore = '';
    39964080        $sqlignore = $seobooster2->seobooster_generateignorelist();
    3997         $prepared = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}sb2_kw WHERE {$sqlignore} `lp` = %s AND kw<>'#' and kw<>'' ORDER BY visits DESC;", $currurl );
     4081        $prepared = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}sb2_kw WHERE {$sqlignore} `lp` = %s AND kw<>'#' and kw<>'' ORDER BY visits DESC LIMIT %d;", $currurl, $limit );
    39984082        $posthits = $wpdb->get_results( $prepared, ARRAY_A );
    39994083        $allowed_html = wp_kses_allowed_html( 'post' );
  • seo-booster/trunk/vendor/collizo4sky/persist-admin-notices-dismissal/CHANGES.md

    r2579952 r2644211  
    1 #### 1.4.4
    2 * Added support for extra dismissible links via `.dismiss-this` CSS class.
    3 
    41#### 1.4.3
    5 * Added filter hook `pand_dismiss_notice_js_url` in case you're using this in a theme or a local environment that doesn't quite find the correct URL.
    6 * Added filter hook `pand_theme_loader` that returns a boolean for simpler usage of the `pand_dismiss_notice_js_url` hook
     2* added filter hook `pand_dismiss_notice_js_url` in case you're using this in a theme or a local environment that doesn't quite find the correct URL.
     3* added filter hook `pand_theme_loader` that returns a boolean for simpler usage of the `pand_dismiss_notice_js_url` hook
    74
    85#### 1.4.2
    96* No changes to `class PAnD`
    10 * Updated `.gitignore` and `.gitattributes`
    11 * Now use classmap in composer's autoloader, should be more efficient
     7* updated `.gitignore` and `.gitattributes`
     8* now use classmap in composer's autoloader, should be more efficient
    129
    1310#### 1.4.1
    14 * Fixed the `forever` setting with options
     11* fixed the `forever` setting with options
    1512
    1613#### 1.4.0
    1714* WPCS 1.1.0 linting done
    18 * Switched from storing timeout in transients to storing in the options table, this should play much better with object caching
     15* switched from storing timeout in transients to storing in the options table, this should play much better with object caching
    1916
    2017#### 1.3.x
    21 * Uses transients to store timeout
     18* uses transients to store timeout
  • seo-booster/trunk/vendor/collizo4sky/persist-admin-notices-dismissal/composer.json

    r2579952 r2644211  
    22    "name": "collizo4sky/persist-admin-notices-dismissal",
    33    "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard.",
    4     "version": "1.4.4",
    5     "type": "library",
    6     "license": "GPL-3.0-or-later",
    74    "authors": [
    85        {
    96            "name": "Collins Agbonghama",
    10             "email": "[email protected]",
    11             "role": "developer"
     7            "email": "[email protected]"
    128        }
    139    ],
    14     "prefer-stable": true,
    15     "require": {
    16         "php": ">=5.4"
    17     },
    18     "support": {
    19         "issues": "https://github.com/w3guy/persist-admin-notices-dismissal/issues",
    20         "source": "https://github.com/w3guy/persist-admin-notices-dismissal"
    21     },
    2210    "autoload": {
    2311        "classmap": [
  • seo-booster/trunk/vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js

    r2579952 r2644211  
    33    $(
    44        function () {
    5             $( 'div[data-dismissible] button.notice-dismiss, div[data-dismissible] .dismiss-this' ).on("click",
     5            $( 'div[data-dismissible] button.notice-dismiss, div[data-dismissible] .dismiss-this' ).click(
    66                function (event) {
    77                    event.preventDefault();
  • seo-booster/trunk/vendor/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php

    r2579952 r2644211  
    44 * Persist Admin notices Dismissal
    55 *
    6  * Copyright (C) 2016 Collins Agbonghama <https://w3guy.com>
     6 * Copyright (C) 2016 Collins Agbonghama <http://w3guy.com>
    77 *
    88 * This program is free software: you can redistribute it and/or modify
     
    2323 * @author  Andy Fragen
    2424 * @license http://www.gnu.org/licenses GNU General Public License
     25 * @version 1.4.3
    2526 */
    2627
  • seo-booster/trunk/vendor/composer/ClassLoader.php

    r2637115 r2644211  
    3838 * @author Fabien Potencier <[email protected]>
    3939 * @author Jordi Boggiano <[email protected]>
    40  * @see    https://www.php-fig.org/psr/psr-0/
    41  * @see    https://www.php-fig.org/psr/psr-4/
     40 * @see    http://www.php-fig.org/psr/psr-0/
     41 * @see    http://www.php-fig.org/psr/psr-4/
    4242 */
    4343class ClassLoader
    4444{
    45     /** @var ?string */
    46     private $vendorDir;
    47 
    4845    // PSR-4
    49     /**
    50      * @var array[]
    51      * @psalm-var array<string, array<string, int>>
    52      */
    5346    private $prefixLengthsPsr4 = array();
    54     /**
    55      * @var array[]
    56      * @psalm-var array<string, array<int, string>>
    57      */
    5847    private $prefixDirsPsr4 = array();
    59     /**
    60      * @var array[]
    61      * @psalm-var array<string, string>
    62      */
    6348    private $fallbackDirsPsr4 = array();
    6449
    6550    // PSR-0
    66     /**
    67      * @var array[]
    68      * @psalm-var array<string, array<string, string[]>>
    69      */
    7051    private $prefixesPsr0 = array();
    71     /**
    72      * @var array[]
    73      * @psalm-var array<string, string>
    74      */
    7552    private $fallbackDirsPsr0 = array();
    7653
    77     /** @var bool */
    7854    private $useIncludePath = false;
    79 
    80     /**
    81      * @var string[]
    82      * @psalm-var array<string, string>
    83      */
    8455    private $classMap = array();
    85 
    86     /** @var bool */
    8756    private $classMapAuthoritative = false;
    88 
    89     /**
    90      * @var bool[]
    91      * @psalm-var array<string, bool>
    92      */
    9357    private $missingClasses = array();
    94 
    95     /** @var ?string */
    9658    private $apcuPrefix;
    9759
    98     /**
    99      * @var self[]
    100      */
    101     private static $registeredLoaders = array();
    102 
    103     /**
    104      * @param ?string $vendorDir
    105      */
    106     public function __construct($vendorDir = null)
    107     {
    108         $this->vendorDir = $vendorDir;
    109     }
    110 
    111     /**
    112      * @return string[]
    113      */
    11460    public function getPrefixes()
    11561    {
     
    12167    }
    12268
    123     /**
    124      * @return array[]
    125      * @psalm-return array<string, array<int, string>>
    126      */
    12769    public function getPrefixesPsr4()
    12870    {
     
    13072    }
    13173
    132     /**
    133      * @return array[]
    134      * @psalm-return array<string, string>
    135      */
    13674    public function getFallbackDirs()
    13775    {
     
    13977    }
    14078
    141     /**
    142      * @return array[]
    143      * @psalm-return array<string, string>
    144      */
    14579    public function getFallbackDirsPsr4()
    14680    {
     
    14882    }
    14983
    150     /**
    151      * @return string[] Array of classname => path
    152      * @psalm-var array<string, string>
    153      */
    15484    public function getClassMap()
    15585    {
     
    15888
    15989    /**
    160      * @param string[] $classMap Class to filename map
    161      * @psalm-param array<string, string> $classMap
    162      *
    163      * @return void
     90     * @param array $classMap Class to filename map
    16491     */
    16592    public function addClassMap(array $classMap)
     
    176103     * appending or prepending to the ones previously set for this prefix.
    177104     *
    178      * @param string          $prefix  The prefix
    179      * @param string[]|string $paths   The PSR-0 root directories
    180      * @param bool            $prepend Whether to prepend the directories
    181      *
    182      * @return void
     105     * @param string       $prefix  The prefix
     106     * @param array|string $paths   The PSR-0 root directories
     107     * @param bool         $prepend Whether to prepend the directories
    183108     */
    184109    public function add($prefix, $paths, $prepend = false)
     
    223148     * appending or prepending to the ones previously set for this namespace.
    224149     *
    225      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    226      * @param string[]|string $paths   The PSR-4 base directories
    227      * @param bool            $prepend Whether to prepend the directories
     150     * @param string       $prefix  The prefix/namespace, with trailing '\\'
     151     * @param array|string $paths   The PSR-4 base directories
     152     * @param bool         $prepend Whether to prepend the directories
    228153     *
    229154     * @throws \InvalidArgumentException
    230      *
    231      * @return void
    232155     */
    233156    public function addPsr4($prefix, $paths, $prepend = false)
     
    273196     * replacing any others previously set for this prefix.
    274197     *
    275      * @param string          $prefix The prefix
    276      * @param string[]|string $paths  The PSR-0 base directories
    277      *
    278      * @return void
     198     * @param string       $prefix The prefix
     199     * @param array|string $paths  The PSR-0 base directories
    279200     */
    280201    public function set($prefix, $paths)
     
    291212     * replacing any others previously set for this namespace.
    292213     *
    293      * @param string          $prefix The prefix/namespace, with trailing '\\'
    294      * @param string[]|string $paths  The PSR-4 base directories
     214     * @param string       $prefix The prefix/namespace, with trailing '\\'
     215     * @param array|string $paths  The PSR-4 base directories
    295216     *
    296217     * @throws \InvalidArgumentException
    297      *
    298      * @return void
    299218     */
    300219    public function setPsr4($prefix, $paths)
     
    316235     *
    317236     * @param bool $useIncludePath
    318      *
    319      * @return void
    320237     */
    321238    public function setUseIncludePath($useIncludePath)
     
    340257     *
    341258     * @param bool $classMapAuthoritative
    342      *
    343      * @return void
    344259     */
    345260    public function setClassMapAuthoritative($classMapAuthoritative)
     
    362277     *
    363278     * @param string|null $apcuPrefix
    364      *
    365      * @return void
    366279     */
    367280    public function setApcuPrefix($apcuPrefix)
     
    384297     *
    385298     * @param bool $prepend Whether to prepend the autoloader or not
    386      *
    387      * @return void
    388299     */
    389300    public function register($prepend = false)
    390301    {
    391302        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
    392 
    393         if (null === $this->vendorDir) {
    394             return;
    395         }
    396 
    397         if ($prepend) {
    398             self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
    399         } else {
    400             unset(self::$registeredLoaders[$this->vendorDir]);
    401             self::$registeredLoaders[$this->vendorDir] = $this;
    402         }
    403303    }
    404304
    405305    /**
    406306     * Unregisters this instance as an autoloader.
    407      *
    408      * @return void
    409307     */
    410308    public function unregister()
    411309    {
    412310        spl_autoload_unregister(array($this, 'loadClass'));
    413 
    414         if (null !== $this->vendorDir) {
    415             unset(self::$registeredLoaders[$this->vendorDir]);
    416         }
    417311    }
    418312
     
    421315     *
    422316     * @param  string    $class The name of the class
    423      * @return true|null True if loaded, null otherwise
     317     * @return bool|null True if loaded, null otherwise
    424318     */
    425319    public function loadClass($class)
     
    430324            return true;
    431325        }
    432 
    433         return null;
    434326    }
    435327
     
    476368    }
    477369
    478     /**
    479      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    480      *
    481      * @return self[]
    482      */
    483     public static function getRegisteredLoaders()
    484     {
    485         return self::$registeredLoaders;
    486     }
    487 
    488     /**
    489      * @param  string       $class
    490      * @param  string       $ext
    491      * @return string|false
    492      */
    493370    private function findFileWithExtension($class, $ext)
    494371    {
     
    562439 *
    563440 * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568441 */
    569442function includeFile($file)
  • seo-booster/trunk/vendor/composer/autoload_classmap.php

    r2637115 r2644211  
    77
    88return array(
    9     'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    109    'PAnD' => $vendorDir . '/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php',
    1110    'TypistTech\\Imposter\\ArrayUtil' => $vendorDir . '/typisttech/imposter/src/ArrayUtil.php',
  • seo-booster/trunk/vendor/composer/autoload_real.php

    r2637115 r2644211  
    2323        }
    2424
    25         require __DIR__ . '/platform_check.php';
    26 
    2725        spl_autoload_register(array('ComposerAutoloaderInit781db4b4892d1b7d96462ad38f838330', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
     26        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    2927        spl_autoload_unregister(array('ComposerAutoloaderInit781db4b4892d1b7d96462ad38f838330', 'loadClassLoader'));
    3028
    3129        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    3230        if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
     31            require_once __DIR__ . '/autoload_static.php';
    3432
    3533            call_user_func(\Composer\Autoload\ComposerStaticInit781db4b4892d1b7d96462ad38f838330::getInitializer($loader));
  • seo-booster/trunk/vendor/composer/autoload_static.php

    r2637115 r2644211  
    2727
    2828    public static $classMap = array (
    29         'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    3029        'PAnD' => __DIR__ . '/..' . '/collizo4sky/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php',
    3130        'TypistTech\\Imposter\\ArrayUtil' => __DIR__ . '/..' . '/typisttech/imposter/src/ArrayUtil.php',
  • seo-booster/trunk/vendor/composer/installed.json

    r2637115 r2644211  
    1 {
    2     "packages": [
    3         {
    4             "name": "collizo4sky/persist-admin-notices-dismissal",
    5             "version": "1.4.4",
    6             "version_normalized": "1.4.4.0",
    7             "source": {
    8                 "type": "git",
    9                 "url": "https://github.com/w3guy/persist-admin-notices-dismissal.git",
    10                 "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/w3guy/persist-admin-notices-dismissal/zipball/900739eb6b0ec0210465f5983a6d4e0e420289e4",
    15                 "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4",
    16                 "shasum": ""
    17             },
    18             "require": {
    19                 "php": ">=5.4"
    20             },
    21             "time": "2020-12-31T17:12:37+00:00",
    22             "type": "library",
    23             "installation-source": "source",
    24             "autoload": {
    25                 "classmap": [
    26                     "persist-admin-notices-dismissal.php"
    27                 ]
    28             },
    29             "notification-url": "https://packagist.org/downloads/",
    30             "license": [
    31                 "GPL-3.0-or-later"
    32             ],
    33             "authors": [
    34                 {
    35                     "name": "Collins Agbonghama",
    36                     "email": "[email protected]",
    37                     "role": "developer"
    38                 }
    39             ],
    40             "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard.",
    41             "install-path": "../collizo4sky/persist-admin-notices-dismissal"
    42         },
    43         {
    44             "name": "typisttech/imposter",
    45             "version": "0.6.1",
    46             "version_normalized": "0.6.1.0",
    47             "source": {
    48                 "type": "git",
    49                 "url": "https://github.com/TypistTech/imposter.git",
    50                 "reference": "f52b1a2289d2ea9c660cf9595085d0b11469af83"
    51             },
    52             "dist": {
    53                 "type": "zip",
    54                 "url": "https://api.github.com/repos/TypistTech/imposter/zipball/f52b1a2289d2ea9c660cf9595085d0b11469af83",
    55                 "reference": "f52b1a2289d2ea9c660cf9595085d0b11469af83",
    56                 "shasum": ""
    57             },
    58             "require": {
    59                 "ext-json": "*",
    60                 "php": "^7.3 || ^8.0"
    61             },
    62             "require-dev": {
    63                 "codeception/codeception": "^4.1",
    64                 "codeception/mockery-module": "^0.4.0",
    65                 "codeception/module-asserts": "^1.3",
    66                 "codeception/module-filesystem": "^1.0",
    67                 "squizlabs/php_codesniffer": "^3.5"
    68             },
    69             "suggest": {
    70                 "typisttech/imposter-plugin": "Composer plugin to integrate composer and imposter"
    71             },
    72             "time": "2020-12-06T22:57:09+00:00",
    73             "type": "library",
    74             "extra": {
    75                 "branch-alias": {
    76                     "dev-master": "0.6.x-dev"
    77                 }
    78             },
    79             "installation-source": "source",
    80             "autoload": {
    81                 "psr-4": {
    82                     "TypistTech\\Imposter\\": "src"
    83                 }
    84             },
    85             "notification-url": "https://packagist.org/downloads/",
    86             "license": [
    87                 "MIT"
    88             ],
    89             "authors": [
    90                 {
    91                     "name": "Typist Tech",
    92                     "email": "[email protected]",
    93                     "homepage": "https://typist.tech"
    94                 },
    95                 {
    96                     "name": "Tang Rufus",
    97                     "email": "[email protected]",
    98                     "homepage": "https://typist.tech",
    99                     "role": "Developer"
    100                 }
    101             ],
    102             "description": "Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins.",
    103             "homepage": "https://github.com/TypistTech/imposter",
    104             "keywords": [
    105                 "composer",
    106                 "dependency",
    107                 "monkey-patching",
    108                 "namespace",
    109                 "wordpress"
    110             ],
    111             "support": {
     1[
     2    {
     3        "name": "collizo4sky/persist-admin-notices-dismissal",
     4        "version": "1.4.4",
     5        "version_normalized": "1.4.4.0",
     6        "source": {
     7            "type": "git",
     8            "url": "https://github.com/w3guy/persist-admin-notices-dismissal.git",
     9            "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4"
     10        },
     11        "dist": {
     12            "type": "zip",
     13            "url": "https://api.github.com/repos/w3guy/persist-admin-notices-dismissal/zipball/900739eb6b0ec0210465f5983a6d4e0e420289e4",
     14            "reference": "900739eb6b0ec0210465f5983a6d4e0e420289e4",
     15            "shasum": ""
     16        },
     17        "require": {
     18            "php": ">=5.4"
     19        },
     20        "time": "2020-12-31T17:12:37+00:00",
     21        "type": "library",
     22        "installation-source": "source",
     23        "autoload": {
     24            "classmap": [
     25                "persist-admin-notices-dismissal.php"
     26            ]
     27        },
     28        "notification-url": "https://packagist.org/downloads/",
     29        "license": [
     30            "GPL-3.0-or-later"
     31        ],
     32        "authors": [
     33            {
     34                "name": "Collins Agbonghama",
     35                "email": "[email protected]",
     36                "role": "developer"
     37            }
     38        ],
     39        "description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard."
     40    },
     41    {
     42        "name": "typisttech/imposter",
     43        "version": "0.6.1",
     44        "version_normalized": "0.6.1.0",
     45        "source": {
     46            "type": "git",
     47            "url": "https://github.com/TypistTech/imposter.git",
     48            "reference": "f52b1a2289d2ea9c660cf9595085d0b11469af83"
     49        },
     50        "dist": {
     51            "type": "zip",
     52            "url": "https://api.github.com/repos/TypistTech/imposter/zipball/f52b1a2289d2ea9c660cf9595085d0b11469af83",
     53            "reference": "f52b1a2289d2ea9c660cf9595085d0b11469af83",
     54            "shasum": ""
     55        },
     56        "require": {
     57            "ext-json": "*",
     58            "php": "^7.3 || ^8.0"
     59        },
     60        "require-dev": {
     61            "codeception/codeception": "^4.1",
     62            "codeception/mockery-module": "^0.4.0",
     63            "codeception/module-asserts": "^1.3",
     64            "codeception/module-filesystem": "^1.0",
     65            "squizlabs/php_codesniffer": "^3.5"
     66        },
     67        "suggest": {
     68            "typisttech/imposter-plugin": "Composer plugin to integrate composer and imposter"
     69        },
     70        "time": "2020-12-06T22:57:09+00:00",
     71        "type": "library",
     72        "extra": {
     73            "branch-alias": {
     74                "dev-master": "0.6.x-dev"
     75            }
     76        },
     77        "installation-source": "source",
     78        "autoload": {
     79            "psr-4": {
     80                "TypistTech\\Imposter\\": "src"
     81            }
     82        },
     83        "notification-url": "https://packagist.org/downloads/",
     84        "license": [
     85            "MIT"
     86        ],
     87        "authors": [
     88            {
     89                "name": "Typist Tech",
    11290                "email": "[email protected]",
    113                 "issues": "https://github.com/TypistTech/imposter/issues",
    114                 "source": "https://github.com/TypistTech/imposter"
    115             },
    116             "funding": [
    117                 {
    118                     "url": "https://typist.tech/donation/",
    119                     "type": "custom"
    120                 },
    121                 {
    122                     "url": "https://www.paypal.me/iAmTangRufus/30usd",
    123                     "type": "custom"
    124                 },
    125                 {
    126                     "url": "https://github.com/tangrufus",
    127                     "type": "github"
    128                 }
    129             ],
    130             "install-path": "../typisttech/imposter"
    131         },
    132         {
    133             "name": "typisttech/imposter-plugin",
    134             "version": "0.6.2",
    135             "version_normalized": "0.6.2.0",
    136             "source": {
    137                 "type": "git",
    138                 "url": "https://github.com/TypistTech/imposter-plugin.git",
    139                 "reference": "15fa3c90aca3b79497f438b9e02a6176498de53c"
    140             },
    141             "dist": {
    142                 "type": "zip",
    143                 "url": "https://api.github.com/repos/TypistTech/imposter-plugin/zipball/15fa3c90aca3b79497f438b9e02a6176498de53c",
    144                 "reference": "15fa3c90aca3b79497f438b9e02a6176498de53c",
    145                 "shasum": ""
    146             },
    147             "require": {
    148                 "composer-plugin-api": "^1.1 || ^2.0",
    149                 "php": "^7.3 || ^8.0",
    150                 "typisttech/imposter": "^0.6.1"
    151             },
    152             "require-dev": {
    153                 "codeception/codeception": "^4.1",
    154                 "codeception/module-asserts": "^1.3",
    155                 "codeception/module-cli": "^1.1",
    156                 "codeception/module-filesystem": "^1.0",
    157                 "composer/composer": "^1.10.19 || ^2.0",
    158                 "squizlabs/php_codesniffer": "^3.5",
    159                 "typisttech/codeception-composer-project-module": "^0.1.1"
    160             },
    161             "time": "2020-12-06T23:41:30+00:00",
    162             "type": "composer-plugin",
    163             "extra": {
    164                 "branch-alias": {
    165                     "dev-master": "0.6.x-dev"
    166                 },
    167                 "class": "TypistTech\\Imposter\\Plugin\\ImposterPlugin"
    168             },
    169             "installation-source": "source",
    170             "autoload": {
    171                 "psr-4": {
    172                     "TypistTech\\Imposter\\Plugin\\": "src"
    173                 }
    174             },
    175             "notification-url": "https://packagist.org/downloads/",
    176             "license": [
    177                 "MIT"
    178             ],
    179             "authors": [
    180                 {
    181                     "name": "Typist Tech",
    182                     "email": "[email protected]",
    183                     "homepage": "https://www.typist.tech"
    184                 },
    185                 {
    186                     "name": "Tang Rufus",
    187                     "email": "[email protected]",
    188                     "homepage": "https://www.typist.tech",
    189                     "role": "Developer"
    190                 }
    191             ],
    192             "description": "Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.",
    193             "homepage": "https://github.com/TypistTech/imposter-plugin",
    194             "keywords": [
    195                 "composer",
    196                 "composer-plugin",
    197                 "dependency",
    198                 "monkey-patching",
    199                 "namespace",
    200                 "wordpress"
    201             ],
    202             "support": {
     91                "homepage": "https://typist.tech"
     92            },
     93            {
     94                "name": "Tang Rufus",
     95                "email": "[email protected]",
     96                "homepage": "https://typist.tech",
     97                "role": "Developer"
     98            }
     99        ],
     100        "description": "Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins.",
     101        "homepage": "https://github.com/TypistTech/imposter",
     102        "keywords": [
     103            "composer",
     104            "dependency",
     105            "monkey-patching",
     106            "namespace",
     107            "wordpress"
     108        ],
     109        "support": {
     110            "email": "[email protected]",
     111            "issues": "https://github.com/TypistTech/imposter/issues",
     112            "source": "https://github.com/TypistTech/imposter"
     113        },
     114        "funding": [
     115            {
     116                "url": "https://typist.tech/donation/",
     117                "type": "custom"
     118            },
     119            {
     120                "url": "https://www.paypal.me/iAmTangRufus/30usd",
     121                "type": "custom"
     122            },
     123            {
     124                "url": "https://github.com/tangrufus",
     125                "type": "github"
     126            }
     127        ]
     128    },
     129    {
     130        "name": "typisttech/imposter-plugin",
     131        "version": "0.6.2",
     132        "version_normalized": "0.6.2.0",
     133        "source": {
     134            "type": "git",
     135            "url": "https://github.com/TypistTech/imposter-plugin.git",
     136            "reference": "15fa3c90aca3b79497f438b9e02a6176498de53c"
     137        },
     138        "dist": {
     139            "type": "zip",
     140            "url": "https://api.github.com/repos/TypistTech/imposter-plugin/zipball/15fa3c90aca3b79497f438b9e02a6176498de53c",
     141            "reference": "15fa3c90aca3b79497f438b9e02a6176498de53c",
     142            "shasum": ""
     143        },
     144        "require": {
     145            "composer-plugin-api": "^1.1 || ^2.0",
     146            "php": "^7.3 || ^8.0",
     147            "typisttech/imposter": "^0.6.1"
     148        },
     149        "require-dev": {
     150            "codeception/codeception": "^4.1",
     151            "codeception/module-asserts": "^1.3",
     152            "codeception/module-cli": "^1.1",
     153            "codeception/module-filesystem": "^1.0",
     154            "composer/composer": "^1.10.19 || ^2.0",
     155            "squizlabs/php_codesniffer": "^3.5",
     156            "typisttech/codeception-composer-project-module": "^0.1.1"
     157        },
     158        "time": "2020-12-06T23:41:30+00:00",
     159        "type": "composer-plugin",
     160        "extra": {
     161            "branch-alias": {
     162                "dev-master": "0.6.x-dev"
     163            },
     164            "class": "TypistTech\\Imposter\\Plugin\\ImposterPlugin"
     165        },
     166        "installation-source": "source",
     167        "autoload": {
     168            "psr-4": {
     169                "TypistTech\\Imposter\\Plugin\\": "src"
     170            }
     171        },
     172        "notification-url": "https://packagist.org/downloads/",
     173        "license": [
     174            "MIT"
     175        ],
     176        "authors": [
     177            {
     178                "name": "Typist Tech",
    203179                "email": "[email protected]",
    204                 "issues": "https://github.com/TypistTech/imposter-plugin/issues",
    205                 "source": "https://github.com/TypistTech/imposter-plugin"
    206             },
    207             "funding": [
    208                 {
    209                     "url": "https://typist.tech/donation/",
    210                     "type": "custom"
    211                 },
    212                 {
    213                     "url": "https://www.paypal.me/iAmTangRufus/30usd",
    214                     "type": "custom"
    215                 },
    216                 {
    217                     "url": "https://github.com/tangrufus",
    218                     "type": "github"
    219                 }
    220             ],
    221             "install-path": "../typisttech/imposter-plugin"
    222         }
    223     ],
    224     "dev": false,
    225     "dev-package-names": []
    226 }
     180                "homepage": "https://www.typist.tech"
     181            },
     182            {
     183                "name": "Tang Rufus",
     184                "email": "[email protected]",
     185                "homepage": "https://www.typist.tech",
     186                "role": "Developer"
     187            }
     188        ],
     189        "description": "Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.",
     190        "homepage": "https://github.com/TypistTech/imposter-plugin",
     191        "keywords": [
     192            "composer",
     193            "composer-plugin",
     194            "dependency",
     195            "monkey-patching",
     196            "namespace",
     197            "wordpress"
     198        ],
     199        "support": {
     200            "email": "[email protected]",
     201            "issues": "https://github.com/TypistTech/imposter-plugin/issues",
     202            "source": "https://github.com/TypistTech/imposter-plugin"
     203        },
     204        "funding": [
     205            {
     206                "url": "https://typist.tech/donation/",
     207                "type": "custom"
     208            },
     209            {
     210                "url": "https://www.paypal.me/iAmTangRufus/30usd",
     211                "type": "custom"
     212            },
     213            {
     214                "url": "https://github.com/tangrufus",
     215                "type": "github"
     216            }
     217        ]
     218    }
     219]
  • seo-booster/trunk/vendor/composer/installed.php

    r2637115 r2644211  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '1.0.0+no-version-set',
    4         'version' => '1.0.0.0',
     3        'pretty_version' => 'dev-develop',
     4        'version' => 'dev-develop',
    55        'type' => 'library',
    66        'install_path' => __DIR__ . '/../../',
    77        'aliases' => array(),
    8         'reference' => NULL,
     8        'reference' => '2ac2f01063fccdfed5fd83740115b8d3c8765800',
    99        'name' => '__root__',
    10         'dev' => false,
     10        'dev' => true,
    1111    ),
    1212    'versions' => array(
    1313        '__root__' => array(
    14             'pretty_version' => '1.0.0+no-version-set',
    15             'version' => '1.0.0.0',
     14            'pretty_version' => 'dev-develop',
     15            'version' => 'dev-develop',
    1616            'type' => 'library',
    1717            'install_path' => __DIR__ . '/../../',
    1818            'aliases' => array(),
    19             'reference' => NULL,
     19            'reference' => '2ac2f01063fccdfed5fd83740115b8d3c8765800',
    2020            'dev_requirement' => false,
    2121        ),
  • seo-booster/trunk/views/404-pages.php

    r2418701 r2644211  
    4242<form id="urls-filter" method="get">
    4343    <input type="hidden" name="page" value="<?php
    44 echo  esc_attr( $_REQUEST['page'] ) ;
     44echo  esc_attr( sanitize_text_field( $_REQUEST['page'] ) );
    4545?>" />
    4646    <?php
     
    5454<form id="reset404s" method="get">
    5555    <input type="hidden" name="page" value="<?php
    56 echo  esc_attr( $_REQUEST['page'] ) ;
     56echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) );
    5757?>" />
    5858    <input type="hidden" name="action" value="deleteall" />
     
    6363
    6464<form id="export404s" method="get" class="profeature">
    65     <input type="hidden" name="page" value="<?php
    66 echo  esc_attr( $_REQUEST['page'] ) ;
    67 ?>" />
     65    <input type="hidden" name="page" value="<?php echo esc_attr( sanitize_text_field( $_REQUEST['page'] ));?>" />
    6866    <input type="hidden" name="action" value="sbp_404_export_csv" />
    69     <input type="hidden" name="_wpnonce" value="<?php
    70 echo  wp_create_nonce( 'sbp-nonce' ) ;
    71 ?>" />
     67    <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'sbp-nonce' ) ); ?>" />
    7268    <?php
    7369submit_button( __( 'Export to .csv', 'seo-booster' ), 'secondary' );
     
    9389        $step++;
    9490        if ( $step < $ipcount ) {
    95             echo  ', ' ;
     91            echo  ', ';
    9692        }
    9793    }
  • seo-booster/trunk/views/autolink-pages.php

    r2418701 r2644211  
    5959
    6060if ( isset( $_POST['btn_reset_pages_autolink'] ) ) {
    61     $nonce = $_REQUEST['_wpnonce'];
     61    $nonce = sanitize_text_field( $_REQUEST['_wpnonce'] );
    6262   
    6363    if ( !wp_verify_nonce( $nonce, 'seobooster_reset_pages_autolink' ) ) {
     
    8282
    8383            <div class="notice notice-success"><p>
    84                 <?php 
    85             echo  esc_html(
     84                <?php
     85            echo esc_html(
    8686                // translators:
    8787                sprintf( __( 'Success! Turned on automatic linking on %s posts and pages.', 'seo-booster' ), number_format_i18n( $stepcount ) )
     
    9898
    9999if ( isset( $_POST['focuskw_convert'] ) ) {
    100     $nonce = $_REQUEST['_wpnonce'];
     100    $nonce = sanitize_text_field( $_REQUEST['_wpnonce'] );
    101101   
    102102    if ( !wp_verify_nonce( $nonce, 'seobooster_convert_focuskw_autolink' ) ) {
    103103        die( 'Security check' );
    104104    } else {
    105         $fokuskw_query = "SELECT {$wpdb->prefix}posts.ID as ID, {$wpdb->prefix}postmeta.meta_value as kw, {$wpdb->prefix}postmeta.meta_key as dakey FROM {$wpdb->prefix}posts, {$wpdb->prefix}postmeta WHERE {$wpdb->prefix}posts.ID = {$wpdb->prefix}postmeta.post_id AND (( {$wpdb->prefix}postmeta.meta_key = '_yoast_wpseo_focuskw' ) OR ( {$wpdb->prefix}postmeta.meta_key = '_yoast_wpseo_focuskeywords' ) ) AND {$wpdb->prefix}postmeta.meta_value <> '' AND {$wpdb->prefix}postmeta.meta_value <> '[]' AND {$wpdb->prefix}posts.post_status = 'publish GROUP BY kw '\n\t\t\tLIMIT {$lookupkwlimit};";
     105        $fokuskw_query = "SELECT {$wpdb->prefix}posts.ID as ID, {$wpdb->prefix}postmeta.meta_value as kw, {$wpdb->prefix}postmeta.meta_key as dakey FROM {$wpdb->prefix}posts, {$wpdb->prefix}postmeta WHERE {$wpdb->prefix}posts.ID = {$wpdb->prefix}postmeta.post_id AND (( {$wpdb->prefix}postmeta.meta_key = '_yoast_wpseo_focuskw' ) OR ( {$wpdb->prefix}postmeta.meta_key = '_yoast_wpseo_focuskeywords' ) ) AND {$wpdb->prefix}postmeta.meta_value <> '' AND {$wpdb->prefix}postmeta.meta_value <> '[]' AND {$wpdb->prefix}posts.post_status = 'publish GROUP BY kw 'LIMIT {$lookupkwlimit};";
    106106        // TODO
    107107        $kwresults = $wpdb->get_results( $fokuskw_query );
     
    128128                    if ( is_array( $focuskeywords ) ) {
    129129                        foreach ( $focuskeywords as $focuskw ) {
    130                             $foundid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}sb2_autolink WHERE `keyword` =\t%s", $focuskw->keyword ) );
     130                            $foundid = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}sb2_autolink WHERE `keyword` = %s", $focuskw->keyword ) );
    131131                           
    132                             if ( !$foundid ) {
     132                            if ( ! $foundid ) {
    133133                                $yoastkwlist[$stepcount]['kw'] = $focuskw->keyword;
    134134                                $yoastkwlist[$stepcount]['lp'] = get_permalink( $kw->ID );
     
    228228<form id="urls-filter" method="get">
    229229    <input type="hidden" name="page" value="<?php
    230 echo  esc_attr( $_REQUEST['page'] ) ;
     230echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) );
    231231?>" />
    232232    <?php
     
    235235    ?>
    236236        <input type="hidden" name="order" value="<?php
    237     echo  esc_attr( $_REQUEST['order'] ) ;
     237    echo esc_attr( sanitize_text_field( $_REQUEST['order'] ) );
    238238    ?>" />
    239239    <?php
     
    246246    ?>
    247247        <input type="hidden" name="orderby" value="<?php
    248     echo  esc_attr( $_REQUEST['orderby'] ) ;
     248    echo esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) ;
    249249    ?>" />
    250250    <?php
     
    330330    <div class="notices notice-info">
    331331        <h3>Import Focus Keywords from Yoast SEO</h3>
    332         <h4>
    333             <?php
     332        <h4><?php
    334333    // translators:
    335     printf( _n(
    336         '%s keyword found',
    337         '%s keywords found',
    338         $yoastkwlistcount,
    339         'seo-booster'
    340     ), intval( $yoastkwlistcount ) );
    341     ?>
    342         </h4>
    343 
    344         <p class="lead">
     334    printf( _n( '%s keyword found', '%s keywords found', $yoastkwlistcount, 'seo-booster' ), intval( $yoastkwlistcount ) );
     335    ?></h4>
     336
     337    <p class="lead">
    345338            <?php
    346339    esc_html_e( 'Import Focus Keyword from Yoast SEO plugin and turn in to links on other pages.', 'seo-booster' );
  • seo-booster/trunk/views/backlink-pages.php

    r2637115 r2644211  
    3434<form id="urls-filter" method="get">
    3535<input type="hidden" name="page" value="<?php
    36 echo  esc_attr( $_REQUEST['page'] ) ;
     36echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) ) ;
    3737?>" />
    3838<?php
     
    4444esc_html_e( 'Note - Backlinks you delete from this list will reappear next time someone visits again.', 'seo-booster' );
    4545?></p>
    46 <p><?php
    47 esc_html_e( 'You can filter out specific domains in the settings.', 'seo-booster' );
    48 ?></p>
     46<p><?php esc_html_e( 'You can filter out specific domains in the settings.', 'seo-booster' ); ?></p>
    4947</div>
    5048</form>
     
    5452<h3>Export Backlinks</h3>   
    5553<form id="exportbacklinks" method="get">
    56 <input type="hidden" name="page" value="<?php
    57 echo  esc_attr( $_REQUEST['page'] ) ;
    58 ?>" />
     54<input type="hidden" name="page" value="<?php echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) ); ?>" />
    5955<input type="hidden" name="action" value="sbp_backlinks_export_csv" />
    60 <input type="hidden" name="_wpnonce" value="<?php
    61 echo  esc_attr( wp_create_nonce( 'sbp-nonce' ) ) ;
    62 ?>" />
    63 <?php
    64 submit_button( 'Export to .csv', 'secondary' );
    65 ?>
     56<input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'sbp-nonce' ) ); ?>" />
     57<?php submit_button( 'Export to .csv', 'secondary' ); ?>
    6658</form>
    67 
    68 
    6959<div class="about__section has-2-columns">
    7060<div class="column">
    71 
    72 
    7361<h3>Top 10 most linked to pages</h3>
    7462<p>Shows the most linked to URLs on your website.</p>
     
    7866<tbody>
    7967<?php
    80 $bls = $wpdb->get_results( "SELECT lp, COUNT(lp) as CNT FROM `{$wpdb->prefix}sb2_bl` GROUP by lp ORDER BY `CNT` DESC LIMIT 10;" );
     68$bls = $wpdb->get_results( "SELECT lp, COUNT(lp) as CNT FROM {$wpdb->prefix}sb2_bl GROUP by lp ORDER BY `CNT` DESC LIMIT 10;" );
    8169
    8270if ( $bls ) {
    8371    foreach ( $bls as $bl ) {
    84         ?><tr><td><a href="<?php echo  esc_url( site_url( $bl->lp ) ) ;?>" target="_blank" rel="noopener"><?php
    85         echo  esc_attr( $bl->lp ) ;
    86         ?></a></td><td><?php
    87         echo  number_format_i18n( $bl->CNT ) ;
    88         ?></td></tr>
     72        ?><tr><td><a href="<?php echo esc_url( site_url( $bl->lp ) ); ?>" target="_blank" rel="noopener"><?php echo esc_attr( $bl->lp ); ?></a></td><td><?php
     73        echo esc_html( number_format_i18n( $bl->CNT ) ); ?></td></tr>
    8974        <?php
    9075    }
     
    136121</div>
    137122</div>
    138 
    139 
    140 
    141 
    142 
    143 
    144 
    145123</div>
  • seo-booster/trunk/views/crawled-pages.php

    r2317644 r2644211  
    2020    <form id="urls-filter" method="get">
    2121        <input type="hidden" name="page" value="<?php
    22 echo  esc_attr( $_REQUEST['page'] ) ;
     22echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) );
    2323?>" />
    2424
     
    3131    <form id="resetcrawls" method="get">
    3232        <input type="hidden" name="page" value="<?php
    33 echo  esc_attr( $_REQUEST['page'] ) ;
     33echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) );
    3434?>" />
    3535        <input type="hidden" name="action" value="deleteall" />
  • seo-booster/trunk/views/forgotten-pages.php

    r2317644 r2644211  
    3030    <div id="wp_pointer-target"></div>
    3131    <form id="urls-filter" method="get">
    32         <input type="hidden" name="page" value="<?php
    33 echo  esc_attr( $_REQUEST['page'] ) ;
    34 ?>" />
    35         <?php
     32        <input type="hidden" name="page" value="<?php echo esc_attr( sanitize_text_field( $_REQUEST['page'] ) );?>" />
     33        <?php
    3634$test_list_table->display();
    3735?>
Note: See TracChangeset for help on using the changeset viewer.