WP Manifestindependent plugin directory
manifest / utilities / wp-abettor

WordPress Abettor

WordPress helper plugin to enable a variety of theme-agnostic features.

by Think_Nathan · github.com/thinknathan/wp-abettor · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/thinknathan/wp-abettor/archive/refs/heads/master.zip

A WordPress plugin which contains a collection of modules to apply theme-agnostic front-end modifications.

Requirements

Prerequisite How to check How to install
PHP >= 7.2.x php -v php.net
Wordpress >= 6.0.0

Installation

You can install this plugin via composer or the WordPress admin panel.

via WordPress Admin Panel

  1. Download the latest zip of this repo.
  2. In your WordPress admin panel, navigate to Plugins->Add New
  3. Click Upload Plugin
  4. Upload the zip file that you downloaded.

Newly Added Modules

  • Disable the admin bar on the front-end
    add_theme_support('abettor', 'disable-admin-bar');

  • Turn off comments and related options and widgets in the back-end interface
    add_theme_support('abettor', 'disable-comments');

  • Logs enqueued scripts and stylesheets to the browser console (Requires get_env)
    add_theme_support('abettor', 'console-log-enqueue');

  • Adds a Logout link to the admin sidebar
    add_theme_support('abettor', 'add-logout-link-admin-sidebar');

  • Adds a View Site link to the admin sidebar
    add_theme_support('abettor', 'add-view-site-admin-sidebar');

  • Remove cruft from text when pasting into the TinyMCE editor
    add_theme_support('abettor', 'tinymce-clean-paste');

  • Removes the back-end admin top bar from larger screens
    add_theme_support('abettor', 'disable-backend-admin-bar');

  • Hide default dashboard widgets on the back-end
    add_theme_support('abettor', 'clean-admin-dashboard');

  • Set default settings for Gravity Forms: CSS output off
    add_theme_support('abettor', 'gravity-forms-setup');

  • Add a fixed position emblem & modifies favicon to differentiate development sites from production sites (Requires get_env)
    add_theme_support('abettor', 'demarcate-development');

Modules

  • Cleaner WordPress markup
    add_theme_support('abettor', 'clean-up');

  • Disable REST API
    add_theme_support('abettor', 'disable-rest-api');

  • Disable asset versioning
    add_theme_support('abettor', 'disable-asset-versioning');

  • Disable trackbacks
    add_theme_support('abettor', 'disable-trackbacks');

  • Move all JS to the footer
    add_theme_support('abettor', 'js-to-footer');

  • Convert search results from /?s=query to /search/query/
    add_theme_support('abettor', 'nice-search');

  • Root relative URLs
    add_theme_support('abettor', 'relative-urls');

And in a format you can copy & paste into your theme:

/**
 * Enable features from WP Abettor when plugin is activated
 * @link https://github.com/thinknathan/wp-abettor/
 */
add_theme_support('abettor', [
    'clean-up',
    'disable-rest-api',
    'disable-asset-versioning',
    'disable-trackbacks',
    'js-to-footer',
    'nice-search',
    'relative-urls'
]);

Module options

Full annotated list of features and options

/**
 * Enable features from WP Abettor when plugin is activated
 * @link https://github.com/thinknathan/wp-abettor/
 */
add_theme_support('abettor', [
    /**
     * Clean up WordPress
     */
    'clean-up' => [
        /**
         * Obscure and suppress WordPress information.
         */
        'wp_obscurity',

        /**
         * Disable WordPress emojis.
         */
        'disable_emojis',

        /**
         * Disable Gutenberg block library CSS.
         */
        'disable_gutenberg_block_css',

        /**
         * Disable extra RSS feeds.
         */
        'disable_extra_rss',

        /**
         * Disable recent comments CSS.
         */
        'disable_recent_comments_css',

        /**
         * Disable gallery CSS.
         */
        'disable_gallery_css',

        /**
         * Clean HTML5 markup.
         */
        'clean_html5_markup',
    ],

    /**
     * Disable WordPress REST API
     */
    'disable-rest-api',

    /**
     * Remove version query string from all styles and scripts
     */
    'disable-asset-versioning',

    /**
     * Disables trackbacks/pingbacks
     */
    'disable-trackbacks',

    /**
     * Moves all scripts to wp_footer action
     */
    'js-to-footer',

    /**
     * Redirects search results from /?s=query to /search/query/, converts %20 to +
     *
     * @link http://txfx.net/wordpress-plugins/nice-search/
     */
    'nice-search',

    /**
     * Convert absolute URLs to relative URLs
     *
     * Inspired by {@link https://web.archive.org/web/20180529232418/http://www.456bereastreet.com/archive/201010/how_to_make_wordpress_urls_root_relative/}
     */
    'relative-urls',
]);

Credits

This project is forked from Roots Soil.

License

This project is licensed under the GPLv2 or any later version.