78% mango-buttons

Code Review | Mango Buttons

WordPress plugin Mango Buttons scored78%from 54 tests.

About plugin

  • Plugin page: mango-buttons
  • Plugin version: 1.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.6.1
  • WordPress version: 6.3.1
  • First release: Apr 6, 2015
  • Latest release: Sep 20, 2016
  • Number of updates: 19
  • Update frequency: every 28.2 days
  • Top authors: philbaylog (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

8,000+ active /79,248 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.23MB] [CPU: ▼13.56ms] Passed 4 tests

Analyzing server-side resources used by Mango Buttons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.77 ▼2.21
Dashboard /wp-admin3.11 ▼0.2029.48 ▼20.39
Posts /wp-admin/edit.php3.24 ▼0.1135.31 ▼10.76
Add New Post /wp-admin/post-new.php5.33 ▼0.5568.24 ▼16.90
Media Library /wp-admin/upload.php3.18 ▼0.0527.81 ▼6.18
Settings /wp-admin/admin.php?page=mangobuttons3.0928.64
Help /wp-admin/admin.php?page=mangobuttons-help3.0927.07

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 46 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
mb_extended_language_support
mb_email
widget_recent-comments
MB_VERSION
db_upgraded
mb_icon_color
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Mango Buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲31714.37 ▼0.281.67 ▼0.1742.45 ▼1.04
Dashboard /wp-admin2,463 ▲2864.95 ▼0.6386.35 ▼13.2687.61 ▲43.54
Posts /wp-admin/edit.php2,390 ▲2902.51 ▲0.5133.53 ▼3.3333.23 ▼1.14
Add New Post /wp-admin/post-new.php1,973 ▲43822.90 ▲4.39639.47 ▼25.8729.67 ▼38.74
Media Library /wp-admin/upload.php1,678 ▲2784.58 ▲0.3997.71 ▼9.4874.17 ▲28.10
Settings /wp-admin/admin.php?page=mangobuttons1,2452.5656.0995.87
Help /wp-admin/admin.php?page=mangobuttons-help1,2362.9052.7256.95

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • MB_VERSION
    • mb_email
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • mb_icon_color
    • mb_extended_language_support

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mangobuttons-help
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mango-buttons/admin/controllers/help.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mango-buttons/admin/ajax/mb-ajax-handler.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mango-buttons/admin/controllers/settings.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
Please take inspiration from this readme.txt

mango-buttons/mango-buttons.php Passed 13 tests

The entry point to "Mango Buttons" version 1.2.9 is a PHP file that has certain tags in its header comment area
118 characters long description:
Mango Buttons is a button creator for WordPress that allows anyone to create beautiful buttons anywhere on their site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin5,666 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
CSS4341472,290
LESS143351181,511
JavaScript82161161,290
PHP415175322
HTML35518194
Markdown16059

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods38
▷ Static methods923.68%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/page-icon.png3.74KB2.81KB▼ 24.76%
admin/images/ads/modal-ad.png49.67KB24.68KB▼ 50.31%
admin/images/TinyMCEButton-grayscale.png7.91KB2.17KB▼ 72.51%
admin/images/ads/sidebar-ad.png13.44KB7.51KB▼ 44.14%
admin/images/menu-icon.png1.20KB0.93KB▼ 22.61%