83% button

Code Review | Button

WordPress plugin Button scored83%from 54 tests.

About plugin

  • Plugin page: button
  • Plugin version: 1.1.26
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: Oct 3, 2016
  • Latest release: Sep 2, 2023
  • Number of updates: 67
  • Update frequency: every 37.7 days
  • Top authors: webdzier (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

3,000+ active /85,819 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼3.64ms] Passed 4 tests

This is a short check of server-side resources used by Button
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.25 ▼0.41
Dashboard /wp-admin3.44 ▲0.1347.66 ▼2.18
Posts /wp-admin/edit.php3.55 ▲0.2052.00 ▲4.08
Add New Post /wp-admin/post-new.php6.02 ▲0.1481.48 ▼16.05
Media Library /wp-admin/upload.php3.36 ▲0.1340.45 ▲4.35
All Buttons /wp-admin/edit.php?post_type=wd_button3.4139.28
Add New Button /wp-admin/post-new.php?post_type=wd_button3.5448.78

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 46 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_wd_button_widget
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.12 ▼0.551.69 ▼0.0640.75 ▼4.19
Dashboard /wp-admin2,206 ▲265.56 ▼0.0899.19 ▲10.6988.10 ▲47.69
Posts /wp-admin/edit.php2,132 ▲351.99 ▲0.0137.90 ▲1.2033.84 ▲2.04
Add New Post /wp-admin/post-new.php1,549 ▲2323.44 ▲0.41791.58 ▲166.1188.55 ▲31.25
Media Library /wp-admin/upload.php1,426 ▲234.23 ▼0.04110.29 ▲9.6776.19 ▲31.52
All Buttons /wp-admin/edit.php?post_type=wd_button1,1582.4641.0481.57
Add New Button /wp-admin/post-new.php?post_type=wd_button4,5943.82145.98144.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_wd_button_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/button/inc/cpt/button-setting.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/button/inc/cpt/button-setting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/button/inc/cpt/button-cpt.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/button/inc/enqueue.php:3
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/button/inc/cpt/button-setting.php on line 2
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/button/inc/cpt/button-layouts.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/button/inc/dynamic-css.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/button/inc/cpt/button-layouts.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/button/inc/duplicate.php:86
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/button/inc/cpt/button-layouts.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Too many tags (48 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

button/button.php 85% from 13 tests

The principal PHP file in "Button" v. 1.1.26 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected12,511 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS51,806639,651
JavaScript76242181,677
PHP122401311,183

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
20 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/layouts/layout-1.png1.21KB0.65KB▼ 46.40%
assets/images/layouts/social-set-1.png7.72KB4.04KB▼ 47.67%
assets/images/layouts/speech-bouble-layout.png0.85KB0.81KB▼ 4.83%
assets/images/layouts/social-set-7.png2.90KB2.84KB▼ 1.79%
assets/images/layouts/social-set-3.png2.37KB2.28KB▼ 3.67%