62% maxbuttons

Code Review | WordPress Button Plugin MaxButtons

WordPress plugin WordPress Button Plugin MaxButtons scored62%from 54 tests.

About plugin

  • Plugin page: maxbuttons
  • Plugin version: 9.7.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 16, 2011
  • Latest release: Oct 12, 2023
  • Number of updates: 406
  • Update frequency: every 11.0 days
  • Top authors: basszje (66.5%)maxfoundry (19.95%)johnbhartley (9.85%)arcware (2.71%)AlanP57 (1.97%)

Code review

54 tests

User reviews

1091 reviews

Install metrics

100,000+ active /4,555,545 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.49MB] [CPU: ▲1.53ms] Passed 4 tests

An overview of server-side resources used by WordPress Button Plugin MaxButtons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.18 ▲1.4559.17 ▲5.35
Dashboard /wp-admin5.06 ▲1.5058.05 ▲1.50
Posts /wp-admin/edit.php5.18 ▲1.5063.47 ▲9.18
Add New Post /wp-admin/post-new.php7.66 ▲1.5195.28 ▼9.92
Media Library /wp-admin/upload.php4.99 ▲1.5060.95 ▲21.38
Buttons /wp-admin/admin.php?page=maxbuttons-controller5.5356.73
Settings /wp-admin/admin.php?page=maxbuttons-settings5.6251.98
Support /wp-admin/admin.php?page=maxbuttons-support5.0244.20
Add New /wp-admin/admin.php?page=maxbuttons-controller&action=edit9.43106.07
Upgrade to Pro /wp-admin/admin.php?page=maxbuttons-pro5.0146.35
Share Buttons /wp-admin/admin.php?page=social-share4.9845.97

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 296 new files
Database: 3 new tables, 10 new options
New tables
wp_maxbuttons_collections
wp_maxbuttons_collections_trans
wp_maxbuttonsv3
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
MBFREE_CREATED
can_compress_scripts
maxbuttons_user_level
MBFREE_HOMEURL
maxbuttons_version
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Button Plugin MaxButtons
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.38 ▼0.051.82 ▲0.0637.08 ▼7.38
Dashboard /wp-admin2,218 ▲385.72 ▲0.0984.88 ▼4.1678.19 ▲38.61
Posts /wp-admin/edit.php2,141 ▲441.98 ▼0.0138.00 ▲0.1533.93 ▼0.92
Add New Post /wp-admin/post-new.php1,541 ▲120.84 ▼2.16758.31 ▲87.5438.27 ▼23.09
Media Library /wp-admin/upload.php1,435 ▲384.27 ▲0.01103.14 ▲0.3065.85 ▲21.58
Buttons /wp-admin/admin.php?page=maxbuttons-controller1,1272.2532.7075.42
Settings /wp-admin/admin.php?page=maxbuttons-settings1,4662.5848.8655.39
Support /wp-admin/admin.php?page=maxbuttons-support1,0892.2230.1258.69
Add New /wp-admin/admin.php?page=maxbuttons-controller&action=edit4,5904.19133.5598.29
Upgrade to Pro /wp-admin/admin.php?page=maxbuttons-pro1,5542.3929.7964.19
Share Buttons /wp-admin/admin.php?page=social-share1,0802.2131.8758.96

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 3 tables
    • wp_maxbuttons_collections
    • wp_maxbuttons_collections_trans
    • wp_maxbuttonsv3
  • This plugin does not fully uninstall, leaving 9 options in the database
    • MBFREE_CREATED
    • db_upgraded
    • widget_recent-posts
    • maxbuttons_user_level
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • MBFREE_HOMEURL
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
Please take a closer look at the following
  • 38× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/maxbuttons/includes/maxbuttons-list.php
    • > /wp-content/plugins/maxbuttons/blocks/dimension.php
    • > /wp-content/plugins/maxbuttons/classes/integrations.php
    • > /wp-content/plugins/maxbuttons/classes/maxCSSParser.php
    • > /wp-content/plugins/maxbuttons/includes/maxbuttons-button.php
    • > /wp-content/plugins/maxbuttons/blocks/advanced.php
    • > /wp-content/plugins/maxbuttons/assets/libraries/font-awesome-5/convert.php
    • > /wp-content/plugins/maxbuttons/blocks/responsive.php
    • > /wp-content/plugins/maxbuttons/classes/maxbuttons-admin-helper.php
    • > /wp-content/plugins/maxbuttons/blocks/meta.php
  • 44× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MaxButtons\\ScssPhp\\ScssPhp\ode' not found in wp-content/plugins/maxbuttons/assets/libraries/scssphp/src/Node/Number.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'MaxButtons\\ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/maxbuttons/assets/libraries/scssphp/src/Formatter/Compressed.php:24
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/maxbuttons/views/modals/trash-modal.php:3
    • > PHP Warning
      file_get_contents(./icons.json): failed to open stream: No such file or directory in wp-content/plugins/maxbuttons/assets/libraries/font-awesome-5/convert.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'MaxButtons\\ScssPhp\\ScssPhp\\Block' not found in wp-content/plugins/maxbuttons/assets/libraries/scssphp/src/Block/DirectiveBlock.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'MaxButtons\\MaxController' not found in wp-content/plugins/maxbuttons/classes/controllers/listController.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'MaxButtons\\ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/maxbuttons/assets/libraries/scssphp/src/Formatter/Crunched.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'MaxButtons\\ScssPhp\\ScssPhp\\Block' not found in wp-content/plugins/maxbuttons/assets/libraries/scssphp/src/Block/MediaBlock.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MaxButtons\\trailingslashit() in wp-content/plugins/maxbuttons/maxbuttons.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'MaxButtons\\MaxController' not found in wp-content/plugins/maxbuttons/classes/controllers/upgradeController.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=maxbuttons-pro
    • > Intervention (severe) in unknown
    /wp-admin/admin.php?page=maxbuttons-controller&action=edit - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: css3 button generator, wordpress buttons, wordpress button plugin, css wordpress button, share button...

maxbuttons/maxbuttons.php 92% from 13 tests

"WordPress Button Plugin MaxButtons" version 9.7.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin36,633 lines of code in 165 files:
LanguageFilesBlank linesComment linesLines of code
PHP1136,2526,68322,195
JSON4005,000
Sass194751572,807
CSS8331552,727
JavaScript117344192,580
PO File13724541,004
Markdown2210256
XML70064

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,493)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 198)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity44.52
▷ Minimum class complexity1.00
▷ Maximum class complexity1,493.00
Average method complexity4.98
▷ Minimum method complexity1.00
▷ Maximum method complexity198.00
Code structure
Namespaces14
Interfaces2
Traits0
Classes91
▷ Abstract classes44.40%
▷ Concrete classes8795.60%
▷ Final classes44.60%
Methods993
▷ Static methods14014.10%
▷ Public methods54955.29%
▷ Protected methods38338.57%
▷ Private methods616.14%
Functions60
▷ Named functions3558.33%
▷ Anonymous functions2541.67%
Constants98
▷ Global constants2626.53%
▷ Class constants7273.47%
▷ Public constants72100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
89 PNG files occupy 1.54MB with 0.95MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/p_top.png20.89KB0.13KB▼ 99.39%
images/gopro/icons/quickadd.png5.70KB3.95KB▼ 30.57%
images/icons/bold.png20.95KB0.18KB▼ 99.13%
images/gopro/social-9.png2.61KB2.49KB▼ 4.75%
images/gopro/s4-pack8.png38.71KB9.03KB▼ 76.68%