78% buttons-shortcode-and-widget

Code Review | Buttons Shortcode and Widget

WordPress plugin Buttons Shortcode and Widget scored78%from 54 tests.

About plugin

  • Plugin page: buttons-shortcode...
  • Plugin version: 1.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9
  • WordPress version: 6.3.1
  • First release: May 7, 2014
  • Latest release: Apr 2, 2022
  • Number of updates: 30
  • Update frequency: every 96.4 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

7,000+ active /163,030 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.10MB] [CPU: ▲6.19ms] Passed 4 tests

A check of server-side resources used by Buttons Shortcode and Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.55 ▲1.0853.14 ▲1.88
Dashboard /wp-admin4.41 ▲1.1059.60 ▲7.13
Posts /wp-admin/edit.php4.45 ▲1.0965.12 ▲13.45
Add New Post /wp-admin/post-new.php7.01 ▲1.1196.13 ▲2.28
Media Library /wp-admin/upload.php4.34 ▲1.1151.20 ▲15.05
Settings /wp-admin/admin.php?page=otw-bsw-settings4.3044.89
otwfcr /wp-admin/admin.php?page=otwfcr4.2944.96
License Manager /wp-admin/admin.php?page=otw-bsw-lm4.36194.49

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 128 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_otw_shortcode_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Buttons Shortcode and Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7914.65 ▲0.291.85 ▼0.0842.83 ▲2.96
Dashboard /wp-admin2,228 ▲485.82 ▲0.2488.17 ▼1.7774.12 ▲28.42
Posts /wp-admin/edit.php2,154 ▲542.29 ▲0.2841.15 ▲0.8735.67 ▼10.05
Add New Post /wp-admin/post-new.php6,240 ▲4,71419.29 ▼3.93878.68 ▲216.1941.28 ▼27.38
Media Library /wp-admin/upload.php1,451 ▲514.51 ▲0.44103.22 ▼9.0182.26 ▲30.51
Settings /wp-admin/admin.php?page=otw-bsw-settings9601.9728.0141.15
otwfcr /wp-admin/admin.php?page=otwfcr8271.8126.2724.78
License Manager /wp-admin/admin.php?page=otw-bsw-lm9711.8227.2126.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_otw_shortcode_widget

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_factory/views/action_message.php
    • > /wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-mailhide.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: return_url in wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_factory/views/action_message.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_esc_text() in wp-content/plugins/buttons-shortcode-and-widget/include/otw_bsw_help.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Shortcodes' not found in wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_shortcode/shortcodes/otw_shortcode_button.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/buttons-shortcode-and-widget/include/otw_labels/otw_bsw_shortcode_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_factory/views/license_manager.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_shortcode/otw_shortcode.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_post() in wp-content/plugins/buttons-shortcode-and-widget/include/otw_bsw_process_actions.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/buttons-shortcode-and-widget/otw_content_manager.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_factory/otw_factory.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/buttons-shortcode-and-widget/include/otw_components/otw_form/otw_form.class.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (WYSIWYG page/post editor button), #2 (OTW Shortcode Widget), #3 (Buttons Options), #4 (Front-end)
The official readme.txt might help

buttons-shortcode-and-widget/otw_content_manager.php 92% from 13 tests

The principal PHP file in "Buttons Shortcode and Widget" v. 1.16 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("buttons-shortcode-and-widget.php" instead of "otw_content_manager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin17,207 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
CSS144721137,722
PHP281,4349154,698
SVG4002,709
JavaScript145061322,061
JSON10017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity76.22
▷ Minimum class complexity1.00
▷ Maximum class complexity193.00
Average method complexity5.26
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods159
▷ Static methods2213.84%
▷ Public methods12075.47%
▷ Protected methods2716.98%
▷ Private methods127.55%
Functions46
▷ Named functions46100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
35 compressed PNG files occupy 0.26MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/otw_components/otw_form/img/select2.png0.60KB0.99KB0.00%
include/otw_components/otw_shortcode/images/pattern-5.png1.83KB1.89KB0.00%
include/otw_components/otw_form/img/select.png0.20KB0.27KB0.00%
include/otw_components/otw_shortcode/images/read-more.png0.17KB0.22KB0.00%
include/otw_components/otw_form/img/colorpicker/colorpicker_rgb_r.png1.04KB0.77KB▼ 26.17%