Plugin Directory

Changeset 2993746

Timestamp:
11/10/2023 08:38:15 AM (9 months ago)
Author:
xlthlx
Message:

Version 1.0.3

Location:
site-toolkit
Files:
39 added
20 edited

Legend:

Unmodified
Added
Removed
  • site-toolkit/trunk/.wp-env.json

    r2942395 r2993746  
    11{
    2   "core":  null,
     2  "core": null,
     3  "themes": [
     4    "https://downloads.wordpress.org/theme/twentytwentyfour.zip"
     5  ],
    36  "plugins": [
    47    "https://downloads.wordpress.org/plugin/wordpress-beta-tester.zip",
     
    710  ],
    811  "mappings": {
    9     "wp-content": "./content"
     12    "wp-content": "./content"
    1013  },
    11   "port": 1000,
    12   "testsPort": 1001,
     14  "port": 100,
     15  "testsPort": 101,
    1316  "config": {
    1417    "WP_DEBUG": true,
  • site-toolkit/trunk/composer.json

    r2942395 r2993746  
    2323  },
    2424  "scripts": {
    25     "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --ignore=vendor/*,node_modules/*,inc/cmb2/*,_root/*,content/* --extensions=php . -n -v --report-file=report.txt",
    26     "lint:wpcs:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --ignore=vendor/*,node_modules/*,inc/cmb2/*,_root/*,content/* --extensions=php .",
     25    "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --ignore=vendor/*,node_modules/*,inc/cmb2/*,content/* --extensions=php . -n -v --report-file=report.txt",
     26    "lint:wpcs:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --ignore=vendor/*,node_modules/*,inc/cmb2/*,content/* --extensions=php .",
    2727    "lint:php": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor .",
    28     "make-pot": "wp i18n make-pot . languages/site-toolkit.pot",
     28    "makepot": "wp i18n make-pot . languages/site-toolkit.pot",
    2929    "readme": "@php ./vendor/wpreadme2markdown/wp2md/bin/wp2md -i readme.txt -o README.md"
    3030  },
  • site-toolkit/trunk/languages/site-toolkit-it_IT.po

    r2845968 r2993746  
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/site-toolkit\n"
    77"POT-Creation-Date: 2023-01-05T12:01:50+00:00\n"
    8 "PO-Revision-Date: 2023-01-05 12:06+0000\n"
     8"PO-Revision-Date: 2023-+0000\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
     
    1414"Content-Transfer-Encoding: 8bit\n"
    1515"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    16 "X-Generator: Poedit 3.2.2\n"
     16"X-Generator: Poedit 3.\n"
    1717"X-Domain: site-toolkit\n"
    1818
     
    122122#: toolkit/admin/class-site-toolkit-options-page.php:324
    123123msgid " options"
    124 msgstr " "
     124msgstr " "
    125125
    126126#: toolkit/admin/class-site-toolkit-options-page.php:349
     
    284284
    285285#: toolkit/admin/class-site-toolkit-options-page.php:799
    286 msgid "Redirects the attachment pages to the homepage."
    287 msgstr "Reindirizza le pagine degli allegati alla homepage."
     286msgid "Redirects the attachment pages to the ."
     287msgstr "Reindirizza le."
    288288
    289289#: toolkit/admin/class-site-toolkit-options-page.php:810
  • site-toolkit/trunk/languages/site-toolkit.pot

    r2942395 r2993746  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Site Toolkit 1.0.2\n"
     5"Project-Id-Version: Site Toolkit 1.0.\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/site-toolkit\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-07-23T15:10:01+01:00\n"
     12"POT-Creation-Date: 2023-:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.8.1\n"
     14"X-Generator: WP-CLI 2.\n"
    1515"X-Domain: site-toolkit\n"
    1616
     
    273273
    274274#: toolkit/admin/class-site-toolkit-options-page.php:782
    275 msgid "Redirects the attachment pages to the homepage."
     275msgid "Redirects the attachment pages to the ."
    276276msgstr ""
    277277
     
    316316msgstr ""
    317317
     318
     319
     320
     321
     322
    318323#: toolkit/inc/posts-columns.php:23
    319324msgid "Thumbnail"
  • site-toolkit/trunk/readme.txt

    r2942395 r2993746  
    44Tags: archives,columns,emoji,header,tools,widgets
    55Requires at least: 5.9
    6 Tested up to: 6.3
     6Tested up to: 6.
    77Requires PHP: 7.4
    8 Stable tag: 1.0.2
     8Stable tag: 1.0.
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3232= Archives =
    33331. Remove Archive Title Prefix: Removes the prefix in the archive title.
    34 2. Redirect Attachments Pages: Redirects the attachment pages to the homepage.
     342. Redirect Attachments Pages: Redirects the attachment pages to the .
    35353. Redirect Archives: Redirects authors archive, dates archive, tags archive to the homepage.
    3636
     
    7777== Changelog ==
    7878
     79
     80
     81
     82
    7983= 1.0.2 =
    8084* Tested up to 6.3
  • site-toolkit/trunk/site-toolkit.php

    r2942395 r2993746  
    1414 * Plugin URI:        https://wordpress.org/plugins/site-toolkit/
    1515 * Description:       Sets of tools for WordPress admin and frontend.
    16  * Version:           1.0.2
    17  * Requires at least: 5.2
     16 * Version:           1.0.
     17 * Requires at least: 5.
    1818 * Requires PHP:      7.4
    1919 * Author:            xlthlx
  • site-toolkit/trunk/toolkit/admin/class-site-toolkit-options-page.php

    r2845968 r2993746  
    780780     */
    781781    public function stk_media_callback() {
    782         $this->stk_create_radio( 'stk_archives', 'media_redirect', __( 'Redirects the attachment pages to the homepage.', 'site-toolkit' ) );
     782        $this->stk_create_radio( 'stk_archives', 'media_redirect', __( 'Redirects the attachment pages to the .', 'site-toolkit' ) );
    783783    }
    784784
  • site-toolkit/trunk/toolkit/inc/archive-title.php

    r2845968 r2993746  
    77
    88/**
    9  * Remove archive title.
     9 * Remove archive title.
    1010 *
    1111 * @param string $title The title.
     
    1515function stk_remove_archive_title_prefix( $title ) {
    1616    $single_cat_title = single_term_title( '', false );
    17     if ( is_category() || is_tag() || is_tax() ) {
     17    if ( is_category() || is_tag() || is_tax() ) {
    1818        return esc_html( $single_cat_title );
    1919    }
  • site-toolkit/trunk/toolkit/inc/custom-login-url.php

    r2845968 r2993746  
    8888        $referer   = wp_get_referer();
    8989        $i_referer = parse_url( $referer );
    90         if ( false !== strpos( $referer, 'wp-activate.php' ) && ! empty( $i_referer['query'] )
    91         ) {
     90        if (
     91       
    9292            parse_str( $referer['query'], $referer );
    9393
     
    242242
    243243    return $wp_classes;
    244 
    245 }
     244}
  • site-toolkit/trunk/toolkit/inc/emoji-support.php

    r2845968 r2993746  
    1515 */
    1616function stk_disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {
    17     if ( 'dns-prefetch' == $relation_type ) {
     17    if ( 'dns-prefetch' == $relation_type ) {
    1818        $emoji_svg_url_bit = 'https://s.w.org/images/core/emoji/';
    1919        foreach ( $urls as $key => $url ) {
     
    3131 */
    3232function stk_disable_emoji_support() {
     33
     34
     35
     36
     37
     38
     39
    3340    remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
    3441    remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
    35     remove_action( 'wp_print_styles', 'print_emoji_styles' );
    3642    remove_action( 'admin_print_styles', 'print_emoji_styles' );
    3743    remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
  • site-toolkit/trunk/toolkit/inc/files-version.php

    r2845968 r2993746  
    6464        // External script/css.
    6565        if ( strpos( $clean_src, site_url() ) === false ) {
    66             $return = preg_replace( '~(\?|&)ver=[^&]*~', '', $src );
     66            $return = preg_replace( '~(\?)ver=[^&]*~', '', $src );
    6767
     68
     69
     70
    6871        }
    6972
  • site-toolkit/trunk/toolkit/inc/header-links.php

    r2845968 r2993746  
    88/**
    99 * Remove default style for comments widget.
     10
     11
    1012 */
    1113function stk_remove_comments_style() {
     
    2729/**
    2830 * Remove RSD link, wlwmanifest Link, Shortlink, Previous/Next Post Link in the header.
     31
     32
    2933 */
    3034function stk_disable_links() {
  • site-toolkit/trunk/toolkit/inc/pages-columns.php

    r2845968 r2993746  
    1414 */
    1515function stk_page_column_views( $columns ) {
    16      unset( $columns['comments'], $columns['date'] );
     16     unset( $columns['date'] );
    1717
    1818    return array_merge(
     
    2020        array(
    2121            'page-layout' => __( 'Template', 'site-toolkit' ),
     22
    2223        )
    2324    );
  • site-toolkit/trunk/toolkit/inc/posts-columns.php

    r2845968 r2993746  
    2121            $columns,
    2222            array(
    23                 'thumbs'   => __( 'Thumbnail', 'site-toolkit' ),
     23                'thumbs' => __( 'Thumbnail', 'site-toolkit' ),
     24                'date'   => __( 'Date', 'site-toolkit' ),
    2425            )
    2526        );
     
    3738function stk_posts_custom_columns( $column_name, $id ) {
    3839    if ( 'thumbs' === $column_name ) {
    39         echo get_the_post_thumbnail( $id, 'thumbnail' );
     40        echo get_the_post_thumbnail( $id, );
    4041    }
    4142}
  • site-toolkit/trunk/toolkit/inc/redirect-attachments.php

    r2845968 r2993746  
    1313
    1414    if ( is_attachment() ) {
    15         if ( isset( $post->post_parent ) && ( 0 !== $post->post_parent ) ) {
    16             wp_redirect( get_permalink( $post->post_parent ), 301 );
    17         } else {
    18             wp_redirect( home_url(), 301 );
    19         }
     15        wp_redirect( wp_get_attachment_image_url( $post->ID, 'full' ), 301 );
    2016        exit;
    2117    }
  • site-toolkit/trunk/toolkit/inc/redirect-author.php

    r2845968 r2993746  
    1212    if ( is_author() ) {
    1313        wp_redirect( home_url(), 301 );
     14
    1415        die();
    1516    }
    1617}
    17 
    18 add_action( 'template_redirect', 'stk_redirect_archives_author' );
  • site-toolkit/trunk/toolkit/inc/redirect-date.php

    r2845968 r2993746  
    1414    if ( is_date() ) {
    1515        wp_redirect( home_url(), 301 );
     16
    1617        die();
    1718    }
  • site-toolkit/trunk/toolkit/inc/redirect-tag.php

    r2845968 r2993746  
    1010 */
    1111function stk_redirect_archives_tag() {
    12     if ( is_author() ) {
     12    if ( is_() ) {
    1313        wp_redirect( home_url(), 301 );
    1414
  • site-toolkit/trunk/toolkit/index.php

    r2845968 r2993746  
    5757    foreach ( $stk_dashboard as $key => $value ) {
    5858        // Radio fields yes/no.
    59         if ( 'yes' === $value ) {
    60             switch ( $key ) {
    61                 case 'dashboard_widgets':
    62                     add_action( 'wp_dashboard_setup', 'stk_disable_dashboard_widgets', 999 );
    63                     break;
    64             }
     59        if ( ( 'yes' === $value ) && ( 'dashboard_widgets' === $key ) ) {
     60            add_action( 'wp_dashboard_setup', 'stk_disable_dashboard_widgets', 999 );
    6561        }
    66         if ( $value ) {
    67             switch ( $key ) {
    68                 case 'custom_widgets_title':
    69                     add_action( 'wp_dashboard_setup', 'stk_add_dashboard_widgets' );
    70                     break;
    71             }
     62        if ( $value && ( 'custom_widgets_title' === $key ) ) {
     63            add_action( 'wp_dashboard_setup', 'stk_add_dashboard_widgets' );
    7264        }
    7365    }
     
    109101                    break;
    110102                case 'media_redirect':
    111                     add_action( 'template_redirect', 'stk_attachment_pages_redirect' );
     103                    if ( false === get_option( 'wp_attachment_pages_enabled' ) ) {
     104                        add_action( 'template_redirect', 'stk_attachment_pages_redirect' );
     105                    } else {
     106                        update_option( 'wp_attachment_pages_enabled', 0 );
     107                    }
    112108                    break;
    113109                case 'redirect_author':
     
    120116                    add_action( 'template_redirect', 'stk_redirect_archives_tag' );
    121117                    break;
     118
     119
     120
     121
    122122            }
    123123        }
     
    155155if ( isset( $stk_login ) ) {
    156156    foreach ( $stk_login as $key => $value ) {
    157         if ( '' !== $value ) {
    158             switch ( $key ) {
    159                 case 'stk_login':
    160                     add_action( 'plugins_loaded', 'stk_plugins_loaded', 1 );
    161                     add_action( 'wp_loaded', 'stk_wp_loaded' );
     157        if ( ( '' !== $value ) && ( 'stk_login' === $key ) ) {
     158            add_action( 'plugins_loaded', 'stk_plugins_loaded', 1 );
     159            add_action( 'wp_loaded', 'stk_wp_loaded' );
    162160
    163                     add_filter( 'site_url', 'stk_site_url', 10, 4 );
    164                     add_filter( 'wp_redirect', 'stk_wp_redirect' );
     161            add_filter( 'site_url', 'stk_site_url', 10, 4 );
     162            add_filter( 'wp_redirect', 'stk_wp_redirect' );
    165163
    166                     add_filter( 'site_option_welcome_email', 'stk_welcome_email' );
    167                     add_filter( 'body_class', 'stk_admin_bar_body_class', 10, 2 );
     164            add_filter( 'site_option_welcome_email', 'stk_welcome_email' );
     165            add_filter( 'body_class', 'stk_admin_bar_body_class', 10, 2 );
    168166
    169                     remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
    170                     break;
    171             }
     167            remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
    172168        }
    173169    }
     
    180176    foreach ( $stk_uploads as $key => $value ) {
    181177        // Radio fields yes/no.
    182         if ( 'yes' === $value ) {
    183             switch ( $key ) {
    184                 case 'clean_names':
    185                     if ( is_admin() ) {
    186                         add_action( 'wp_handle_upload_prefilter', 'stk_upload_filter' );
    187                         add_action( 'add_attachment', 'stk_update_attachment_title' );
    188                     }
    189                     break;
    190             }
     178        if ( ( 'yes' === $value ) && ( 'clean_names' === $key ) && is_admin() ) {
     179            add_action( 'wp_handle_upload_prefilter', 'stk_upload_filter' );
     180            add_action( 'add_attachment', 'stk_update_attachment_title' );
    191181        }
    192182    }
    193183}
    194 
    195 
Note: See TracChangeset for help on using the changeset viewer.