78% separator-shortcode-and-widget

Code Review | Separator Shortcode and Widget

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

About plugin

  • Plugin page: separator-shortco...
  • Plugin version: 1.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9
  • WordPress version: 6.3.1
  • First release: May 30, 2014
  • Latest release: Apr 2, 2022
  • Number of updates: 19
  • Update frequency: every 150.7 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /15,514 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.02MB] [CPU: ▲7.12ms] Passed 4 tests

An overview of server-side resources used by Separator Shortcode and Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.47 ▲1.0151.79 ▲6.43
Dashboard /wp-admin4.32 ▲1.0262.68 ▲11.14
Posts /wp-admin/edit.php4.38 ▲1.0261.97 ▲14.67
Add New Post /wp-admin/post-new.php6.93 ▲1.04113.09 ▼3.63
Media Library /wp-admin/upload.php4.26 ▲1.0452.33 ▲14.52
License Manager /wp-admin/admin.php?page=otw-spsw-lm4.28181.25
otwfcr /wp-admin/admin.php?page=otwfcr4.2145.64
Settings /wp-admin/admin.php?page=otw-spsw-settings4.2244.61

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 127 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_otw_shortcode_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Separator Shortcode and Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.39 ▼1.332.13 ▼0.1342.51 ▼3.20
Dashboard /wp-admin2,234 ▲495.00 ▲0.09108.56 ▼8.9687.27 ▲42.32
Posts /wp-admin/edit.php2,141 ▲552.49 ▲0.5035.41 ▼2.6333.22 ▼7.18
Add New Post /wp-admin/post-new.php6,401 ▲4,88122.80 ▼0.45908.32 ▲260.7539.05 ▼13.22
Media Library /wp-admin/upload.php1,443 ▲554.48 ▲0.26110.70 ▲5.8980.48 ▲35.51
License Manager /wp-admin/admin.php?page=otw-spsw-lm9571.8728.0727.99
otwfcr /wp-admin/admin.php?page=otwfcr7731.8928.2723.27
Settings /wp-admin/admin.php?page=otw-spsw-settings9192.0228.5239.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_otw_shortcode_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/separator-shortcode-and-widget/include/otw_components/otw_factory/views/action_message.php
    • > /wp-content/plugins/separator-shortcode-and-widget/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-mailhide.php
  • 14× 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/separator-shortcode-and-widget/include/otw_components/otw_factory/views/action_message.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/separator-shortcode-and-widget/include/otw_components/otw_form/otw_form.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_post() in wp-content/plugins/separator-shortcode-and-widget/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-captcha.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/separator-shortcode-and-widget/otw_content_manager.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/separator-shortcode-and-widget/include/otw_labels/otw_spsw_factory_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/separator-shortcode-and-widget/include/otw_components/otw_shortcode/widgets/otw_shortcode_widget.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/separator-shortcode-and-widget/include/otw_spsw_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_post() in wp-content/plugins/separator-shortcode-and-widget/include/otw_spsw_process_actions.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Shortcodes' not found in wp-content/plugins/separator-shortcode-and-widget/include/otw_components/otw_shortcode/shortcodes/otw_shortcode_divider.class.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/separator-shortcode-and-widget/include/otw_components/otw_factory/views/license_manager.php:3

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 93% 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
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (WYSIWYG page/post editor button), #2 (OTW Shortcode Widget), #3 (Separator Options), #4 (Front-end)
You can take inspiration from this readme.txt

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

The primary PHP file in "Separator Shortcode and Widget" version 1.13 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("separator-shortcode-and-widget.php" instead of "otw_content_manager.php")

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
Everything looks great! No dangerous files found in this plugin16,929 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
CSS144721137,722
PHP271,4229214,420
SVG4002,709
JavaScript145061322,061
JSON10017

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity75.67
▷ Minimum class complexity1.00
▷ Maximum class complexity193.00
Average method complexity5.23
▷ 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%
Functions47
▷ Named functions47100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
35 compressed PNG files occupy 0.15MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/otw_components/otw_form/img/colorpicker/colorpicker_hex.png0.52KB0.42KB▼ 19.92%
include/otw_components/otw_shortcode/images/blockquote-testimonial.png0.16KB0.20KB0.00%
include/otw_components/otw_shortcode/images/pattern-4.png0.09KB0.12KB0.00%
include/otw_components/otw_form/img/colorpicker/colorpicker_submit.png0.96KB1.04KB0.00%
include/otw_components/otw_form/img/select.png0.20KB0.27KB0.00%