Coder Social home page Coder Social logo

binarymoon / wp-toolbelt Goto Github PK

View Code? Open in Web Editor NEW
177.0 10.0 12.0 3.72 MB

A lightweight, multi-purpose, WordPress plugin with a focus on privacy and speed

Home Page: https://prothemedesign.com

License: GNU General Public License v2.0

PHP 52.20% JavaScript 42.52% CSS 0.01% SCSS 5.27%
wordpress wordpress-plugin privacy lightweight-plugin wp-toolbelt

wp-toolbelt's Introduction

WP Toolbelt

Travis build process

A lightweight plugin inspired by Jetpack but designed for privacy, speed, and accessibility.

Speed?

I want it to be fast. I want to be able to enable any of the features and not have my Google Pagespeed score drop. To be fast it:

  • Doesn't use jQuery or any other javascript framework. All javascript is vanilla js, and minified.
  • Minifies all assets (JS and CSS)
  • Loads all assets inline. They are already small, and loading them directly on the page means there are no server requests.
  • Only loads things when they are needed. JS and CSS are only loaded for activated modules.
  • Options? There's only one for the database; an array that stores what modules are active.
  • Uses the minimum code possible. Minimum Javascript and PHP. Less code means more speed, and fewer bugs.
  • All modules are disabled by default. You only enable the ones you need.

Privacy? GDPR?

To ensure the plugin is as privacy focused as possible it:

  • Does not phone out. No data is shared with third parties.
  • Does not use standard social sharing javascripts (loaded from social networks servers).
  • Does not track your usage of the plugin.
  • Does not add generator comments, or secret comments to your site html.

Features

Thanks!

This plugin is heavily inspired by the Jetpack and Machete plugins. A lot of the modules use code from these plugins as starting points.

wp-toolbelt's People

Contributors

binarymoon avatar dependabot[bot] avatar herrschuessler avatar ndegruchy avatar pixolin avatar szepeviktor avatar walterebert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-toolbelt's Issues

Enhance usability with better menu titles

The backend menu Toolbelt shows three menu items named Toolbelt, Settings and Tools. The difference between these submenus isn't obvious. To enhance usability I may suggest to rename them after their content and also reorder them with Advanced Settings as last menu item:

Toolbelt

  • Modules
  • Module Properties
  • Advanced Settings

(It would be my pleasure to add a pull request, if you agree to these changes.)

Custom message on cookie banner and button

Hi. I try to use custom text for cookie banner message. I use this code but nothing happends.

function my_cookie_banner_message( $message ) {
return 'My site uses cookies!';
}
add_filter( 'tb_cookie_message', 'my_cookie_banner_message' );

And how to change text on accept button for cookie banner. Thanks a lot for any suggestions and help.

image optimizing CDN

I was reading about your new plugin on WP Tavern today, and it mentioned that some things, like an image CDN and statistics, would be difficult to implement since it seems you are trying to be very privacy-focused with this plugin.

I share your concerns about the performance of JetPack, and am very much in the business of helping folks make their sites performant (EWWW Image Optimizer), so I wanted to reach out to you directly. Unfortunately, your contact form wasn't working for me, so here I am!

If you're ever interested in adding some sort of image-optimizing CDN to the Toolbelt, please reach out to me at https://ewww.io/contact-us/
We do our best to be very privacy-oriented, with our zero-storage optimization API, and we don't log any user data on our image-optimizing CDN (ExactDN). We just recently released a very lean version of our ExactDN service + lazy loading called Easy Image Optimizer, and I think it could be a great fit for your target audience.

Take care,
Shane Bishop
EWWW IO

add 'weight' column to the settings page

Calculate the weight of the files that will be added to the page when a setting is enabled

This will emphasise the speed of the theme and make users aware of the impact of their decisions

Group modules in the admin

To make it easier to find different modules consider grouping them so that the correct module can be found more quickly.

May also be worth adding a search?

[ask for explaination] of fast 404

Do I get it right, that - without your or another plugin - when there is an eg image that is not found it will be answered with a 404.
And that 404 page is the WordPress 404 page that also is loaded if a blog post is not found.

So instead of an image all the resources etc. of the 404 page will be loaded?

And your plugin supresses that, right?
What happens instead?
(Will check the code in a minute - want to ask anyway + want to encourage to add a sentence to the doc)

Question re: my_related_posts_type

Hi, great plugin but I'm a bit confused by this part of my_related_posts_type:

https://github.com/BinaryMoon/wp-toolbelt/wiki/Related-Posts#toolbelt_related_posts_types

Is the example code correct, with the reference to toolbelt_portfolio_related_posts_type? Does it mean I can display related custom post types?

For example - if want to display related 'event' post types, on a single event, with the same 'event-type' taxonomy... is that this offers? By doing this:

$types['event'] = 'event-type';

Many thanks!

Missing Text Domain in Plugin Header

The plugin uses text-domain wp-toolbelt in various functions, but is missing a Text Domain header to allow localization in the WordPress plugin repository.

Use CSS Scroll margin

Add support for scroll-margin-top to global css. This will stop elements that scroll to anchor (such as heading anchor links) from being covered by the WordPress admin bar when you are logged in. It should use an overridable css variable so that users can change the setting if they want.

Infinite Scroll: "Load More" never hidden because HTML response is never empty

Hello! Loving wp-toolbelt so far. Thanks for making it available.

Ran into an issue, I think, with Infinite Scroll:

It appears the intention in infiniteScroll.js is once the Loop has been exhausted and no more HTML is being returned, the "Load More" button should disappear.

However, because <h6 class="toolbelt-divider">Page X<h6> is prepended to the HTML an empty string is never returned and the button never disappears.

Thanks again for the plugin!

Problem with cookie banner

Hi. I`m testing cookie banner.

I`m use this function on my website:

function my_cookies_accepted() {
  ?>
  console.log( 'cookies accepted' );
  <?php
  }
  add_action( 'toolbelt_cookies_accepted', 'my_cookies_accepted' );

  function my_cookie_banner_message( $message ) {
    return 'Strona wykorzystuje pliki cookies w celu prawidłowego funkcjonowania oraz możliwości korzystania z narzędzi analitycznych, reklamowych i społecznościowych. Szczegóły ich wykorzystania znajdziesz w: <a href="/polityka-prywatnosci-i-plikow-cookie/">Polityka prywatności i plików cookie.</a>';
}
add_filter( 'toolbelt_cookie_message', 'my_cookie_banner_message' );

function my_cookie_button_text( $text ) {
  $text['accept'] = 'Ok, zgadzam się';
  return $text;
}
add_filter( 'toolbelt_cookie_button_text', 'my_cookie_button_text' );

After click ok banner dissapear and looks ok. But after refresh page is show off again and every time you click ok nothing happends. What I doing wrong ??

Link to website: https://eallora.pl/

Admin menu items not translatable

Currently the admin menu Toolbelt shows three menu items Toolbelt, Settings and Tools, which aren't translatable due to a missing function.

Logged in and Logged out users are getting different scripts and stylesheets with Toolbelt enabled.

When WP Toolbelt is enabled on our site logged out users are getting pages that look very broken. This is due to multiple scripts and stylesheets not getting loaded and possibly other errors. Everything goes back to normal and works great when I disable this plugin.

I absolutely love this plugin and really don't want to leave it disabled. So I am hoping this can be figured out.

Again the important bit for me, logged in users are working fine. This is only happening to logged out users. I would be happy to allow you access to my site to debug if needed. It is currently in development and not open to the public yet, so I prefer not to post it, or screenshots of it.

Plugin adds toolbelt-properties CSS to frontend

Thank's for a great plugin. I have noticed that the plugin adds a CSS snippet to the frontend, is this needed?

<style name="toolbelt-properties">:root { --toolbelt-spacing:1rem;}</style>

Toolbelt Porfolio Tag Pages Don't Work

When trying to view tag or category pages from the Portfolio tools, they just lead back to the homepage. With Jetpack's implementation, you were able to view Project Types and Tags as lists of their related posts.

Check JavaScripts too

You may look for a tool to guard JavaScript code quality.

A liberal choice is ESLint.

JSLint will teach you how to produce robust code. (although fiddly to use on the command line)

Make the list of static social networks filterable

Add a filter for the social networks so they can be added & edited.

In principle this is simple but I need to work out an elegant way to make the svg icons work.

Perhaps there could be an optional 'image' parameter. By default the plugin uses the key to work out the icon location, but if the image param exists that could be used instead?

Wrapping modules in classes

If you use classes instead of global functions you may benefit from the brand new annotation based hooking
https://github.com/szepeviktor/Toolkit4WP/blob/master/src/HookAnnotation.php#L25

namespace BinaryMoon\WpToolbelt;

use Toolkit4WP\HookAnnotation;

class AdminTweaks
{
    use HookAnnotation;

    public function __construct()
    {
        $this->hookMethods();
    }

    /**
     * Display some custom css to tweak the WordPress admin.
     *
     * @hook admin_head 20
     */
    public function adminTweaks() {
		...
	}
}

Widget Display 'exclusion' doesn't seem to be working

I have a widget I want to display in the footer everywhere except for one specific page - say, page id: 414. I've been looking over the documentation for this feature...

If I add this rule to the widget: single:-414

That widget doesn't display anywhere on the site. How do I need to modify my rule(s)?

Adding a module for Publishing Widgets on select pages

Feature Enhancement - So far things look great, but one very important item to consider is to add a module to the Toolbelt that lets a person publish widgets to select pages/posts/taxonomies, etc. I know Jetpack has Widget Visibility, but it's not 100% functional. It also requires some input by the user in the form of WP conditionals, which is not really something a typical user should use because conditionals are more of a developer thing.

For myself, I've been using the Widget Options plugin, which is pretty good, but it's bloated; but their options to publish widgets is very good. They even have an option to disable widget titles (good if one uses a widget to show a slider or banner image (you don't want a title for it showing). But that is another possible feature and will maybe post that later.

related posts module

Create a simple related posts module that adds posts to the end of 'the_content'

Active consent needed for tracking cookies

Currently Toolbelt's Cookie banner shows a message

By using this website, you agree to our cookie policy [X]

Website visitors can only remove the message with a click on a close-icon which assumes they agree with the message. Users don't have the possibility to opt out and can't consent actively.

I'm not a lawyer, but as far as I know, this procedure isn't valid:

… pre-checked consent boxes (or cookie banners that tell you a cookie has already been dropped and pointlessly invite you to click ‘ok’) aren’t valid under EU law.

(Source: TechCrunch: Europe’s top court says active consent is needed for tracking cookies

Improve cookie checks

A function for registering what scripts should be loaded and then automatically dequeing them if cookies have not been accepted.

Filter pages from social shareds

I love that the social share buttons just show up everywhere by default. I want it on 90% of my site. But there are a few pages that I need it to be hidden on. I could do this with CSS specific to those pages. Wouldn't it be better to have a list of page ids to filter out?

Static analysis by @phpstan

Are you interested in the tool?

 ------ --------------------------------------
  Line   admin/index.php
 ------ --------------------------------------
  239    Variable $to might not be defined.
  240    Variable $from might not be defined.
  249    Variable $to might not be defined.
  250    Variable $from might not be defined.
  259    Variable $to might not be defined.
  260    Variable $from might not be defined.
 ------ --------------------------------------

 ------ --------------------------------------------------------------------------------------------------------
  Line   modules/breadcrumbs/index.php
 ------ --------------------------------------------------------------------------------------------------------
  52     Variable $breadcrumb might not be defined.
  110    Function toolbelt_breadcrumb_tax_hierarchical() should return string but empty return statement found.
  176    Function toolbelt_get_term_parents() should return string but returns WP_Error.
  183    Function jetpack_get_term_parents not found.
 ------ --------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------
  Line   modules/cleanup/index.php
 ------ -----------------------------------------------------------------
  27     Function remove_action invoked with 4 parameters, 2-3 required.
  28     Function remove_action invoked with 4 parameters, 2-3 required.
  31     Function remove_action invoked with 4 parameters, 2-3 required.
  32     Function remove_action invoked with 4 parameters, 2-3 required.
 ------ -----------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------
  Line   modules/disable-comment-urls/index.php
 ------ ------------------------------------------------------------------------------------------------------------
  17     Parameter $author_link of function toolbelt_disable_comment_author_links() has invalid typehint type type.
  35     Function toolbelt_comment_form_fields() should return string but returns array.
 ------ ------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------
  Line   modules/social-menu/index.php
 ------ -------------------------------------------------------------------------------------------------------
  62     Function toolbelt_social_menu_svg() never returns null so it can be removed from the return typehint.
  130    Cannot access property $theme_location on array.
  140    Cannot access property $link_after on array.
 ------ -------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------
  Line   modules/social-sharing/index.php
 ------ -----------------------------------------------------------------
  60     Variable $_SERVER in isset() always exists and is not nullable.
 ------ -----------------------------------------------------------------

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.