62% visual-editor-custom-buttons

Code Review | Visual Editor Custom Buttons

WordPress plugin Visual Editor Custom Buttons scored62%from 54 tests.

About plugin

  • Plugin page: visual-editor-cus...
  • Plugin version: 1.6.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 9, 2012
  • Latest release: May 26, 2023
  • Number of updates: 136
  • Update frequency: every 28.1 days
  • Top authors: cyberduck (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

6,000+ active /145,602 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼1.14MB] [CPU: ▼48.75ms] Passed 4 tests

This is a short check of server-side resources used by Visual Editor Custom Buttons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6315.20 ▼26.48
Dashboard /wp-admin2.87 ▼0.4322.57 ▼30.12
Posts /wp-admin/edit.php2.87 ▼0.4817.14 ▼29.41
Add New Post /wp-admin/post-new.php2.87 ▼3.0121.41 ▼108.99
Media Library /wp-admin/upload.php2.87 ▼0.3517.80 ▼16.76
Add new /wp-admin/post-new.php?post_type=vecb_editor_buttons2.8818.08
All buttons /wp-admin/edit.php?post_type=vecb_editor_buttons2.8818.60

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 95 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Visual Editor Custom Buttons: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲10013.35 ▼0.811.90 ▼0.2243.41 ▼0.65
Dashboard /wp-admin2,249 ▲645.21 ▲0.31114.76 ▲13.1642.96 ▲4.08
Posts /wp-admin/edit.php2,132 ▲432.31 ▲0.3044.94 ▲6.7335.68 ▼0.39
Add New Post /wp-admin/post-new.php1,551 ▲3722.77 ▲5.27657.10 ▲52.1973.53 ▲17.86
Media Library /wp-admin/upload.php1,434 ▲494.54 ▲0.32104.73 ▲0.5744.42 ▲1.28
Add new /wp-admin/post-new.php?post_type=vecb_editor_buttons2,5483.2482.2468.73
All buttons /wp-admin/edit.php?post_type=vecb_editor_buttons1,0992.2736.9430.19
Settings /wp-admin/visual-editor-custom-buttons.php260.440.0715.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% 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
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=vecb_editor_buttons
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.

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
Almost there! Just fix the following items
  • 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/visual-editor-custom-buttons/visual-editor-custom-buttons.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=vecb_editor_buttons
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=vecb_editor_buttons 456:4 Uncaught ReferenceError: QTags is not defined
    • > GET request to /wp-admin/edit.php?post_type=vecb_editor_buttons
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=vecb_editor_buttons 297:4 Uncaught ReferenceError: QTags is not defined
    • > GET request to /wp-admin/visual-editor-custom-buttons.php
    • > Network (severe)
    wp-admin/visual-editor-custom-buttons.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt is a good inspiration

visual-editor-custom-buttons/visual-editor-custom-buttons.php Passed 13 tests

The main PHP file in "Visual Editor Custom Buttons" ver. 1.6.0.3 adds more information about the plugin and also serves as the entry point for this plugin
49 characters long description:
Create custom buttons in Wordpress Visual Editor.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected988 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP1389168661
CSS3303160
PO File13234101
JavaScript2331366

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
84 PNG files occupy 0.11MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/icons/picasa.png1.46KB0.44KB▼ 69.62%
js/icons/squares_sixteen.png0.99KB0.11KB▼ 88.50%
js/icons/line_single.png0.97KB0.11KB▼ 89.06%
js/icons/user.png1.26KB0.31KB▼ 75.10%
js/icons/tab_space.png1.23KB0.42KB▼ 65.71%