78% mww-disclaimer-buttons

Code Review | MWW Disclaimer Buttons

WordPress plugin MWW Disclaimer Buttons scored78%from 54 tests.

About plugin

  • Plugin page: mww-disclaimer-bu...
  • Plugin version: 3.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2+
  • WordPress version: 6.3.1
  • First release: Sep 14, 2016
  • Latest release: Aug 19, 2023
  • Number of updates: 61
  • Update frequency: every 41.5 days
  • Top authors: mossifer (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

800+ active /8,329 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.86ms] Passed 4 tests

Server-side resources used by MWW Disclaimer Buttons
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0433.94 ▼7.49
Dashboard /wp-admin3.35 ▲0.0444.13 ▼3.73
Posts /wp-admin/edit.php3.40 ▲0.0447.88 ▲5.57
Add New Post /wp-admin/post-new.php5.96 ▲0.0789.41 ▼3.53
Media Library /wp-admin/upload.php3.27 ▲0.0435.77 ▼0.70
Disclaimer Buttons /wp-admin/options-general.php?page=mww-disclaimers3.2228.26

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for MWW Disclaimer Buttons
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6613.81 ▼0.561.88 ▼0.1241.36 ▼6.49
Dashboard /wp-admin2,229 ▲385.14 ▲0.28111.11 ▲3.9036.53 ▼11.20
Posts /wp-admin/edit.php2,120 ▲282.31 ▲0.2641.16 ▼0.9843.21 ▲8.81
Add New Post /wp-admin/post-new.php6,244 ▲4,71126.28 ▲2.88901.18 ▲210.2335.89 ▼14.45
Media Library /wp-admin/upload.php1,411 ▲234.39 ▲0.07100.52 ▼7.1642.68 ▼3.22
Disclaimer Buttons /wp-admin/options-general.php?page=mww-disclaimers1,3112.6563.3832.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mww-disclaimers
    • > Notice in wp-content/plugins/mww-disclaimer-buttons/mww-disclaimers.php+188
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mww-disclaimer-buttons/mww-disclaimers.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === mww-disclaimer-buttons === )
Please take inspiration from this readme.txt

mww-disclaimer-buttons/mww-disclaimers.php 92% from 13 tests

The entry point to "MWW Disclaimer Buttons" version 3.0.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mww-disclaimer-buttons.php" instead of "mww-disclaimers.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin203 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP13716187
CSS13613
JavaScript1003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected