78% lists-shortcode-and-widget

Code Review | Lists Shortcode and Widget

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

About plugin

  • Plugin page: lists-shortcode-a...
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9
  • WordPress version: 6.3.1
  • First release: May 30, 2014
  • Latest release: Mar 4, 2022
  • Number of updates: 17
  • Update frequency: every 166.8 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /6,133 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.91MB] [CPU: ▲5.94ms] Passed 4 tests

A check of server-side resources used by Lists Shortcode and Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.37 ▲0.9149.90 ▲11.40
Dashboard /wp-admin4.22 ▲0.9254.58 ▲7.45
Posts /wp-admin/edit.php4.28 ▲0.9261.29 ▲15.27
Add New Post /wp-admin/post-new.php6.83 ▲0.94102.87 ▼3.21
Media Library /wp-admin/upload.php4.15 ▲0.9146.05 ▲8.13

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lists Shortcode and Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9514.51 ▲0.141.69 ▲0.0738.14 ▼4.27
Dashboard /wp-admin2,219 ▲315.05 ▲0.12113.59 ▲11.7299.91 ▲54.88
Posts /wp-admin/edit.php2,129 ▲402.33 ▲0.3140.55 ▼1.9834.57 ▼2.10
Add New Post /wp-admin/post-new.php6,220 ▲4,68721.87 ▼1.34877.66 ▲256.4144.28 ▼18.86
Media Library /wp-admin/upload.php1,422 ▲344.34 ▲0.13102.62 ▲7.2885.14 ▲42.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_otw_shortcode_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/lists-shortcode-and-widget/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-mailhide.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/lists-shortcode-and-widget/include/otw_components/otw_shortcode/widgets/otw_shortcode_widget.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_esc_text() in wp-content/plugins/lists-shortcode-and-widget/include/otw_lssw_help.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lists-shortcode-and-widget/include/otw_labels/otw_lssw_shortcode_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Shortcodes' not found in wp-content/plugins/lists-shortcode-and-widget/include/otw_components/otw_shortcode/shortcodes/otw_shortcode_ordered_list.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/lists-shortcode-and-widget/otw_content_manager.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Shortcodes' not found in wp-content/plugins/lists-shortcode-and-widget/include/otw_components/otw_shortcode/shortcodes/otw_shortcode_unordered_list.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/lists-shortcode-and-widget/include/otw_components/otw_validator/otw_validator.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_post() in wp-content/plugins/lists-shortcode-and-widget/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-captcha.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/lists-shortcode-and-widget/include/otw_components/otw_form/otw_form.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/lists-shortcode-and-widget/include/otw_lssw_settings.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (WYSIWYG page/post editor button), #2 (OTW Shortcode Widget), #3 (Lists Options), #4 (Front-end)
The official readme.txt might help

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

Analyzing the main PHP file in "Lists Shortcode and Widget" version 1.8
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("lists-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
Good job! No executable or dangerous file extensions detected11,128 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
CSS124701035,222
PHP231,2059263,790
JavaScript145061322,061
SVG30038
JSON10017

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity56.33
▷ Minimum class complexity1.00
▷ Maximum class complexity173.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods143
▷ Static methods2215.38%
▷ Public methods11076.92%
▷ Protected methods2718.88%
▷ Private methods64.20%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 PNG files occupy 0.27MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/otw_components/otw_form/img/colorpicker/select.png3.20KB0.46KB▼ 85.54%
include/otw_components/otw_shortcode/images/diag-background-translucent-darker.png0.08KB0.10KB0.00%
include/otw_components/otw_form/img/colorpicker/colorpicker_hex.png0.52KB0.42KB▼ 19.92%
include/otw_components/otw_shortcode/images/pattern-2.png0.12KB0.13KB0.00%
screenshot-4.png112.46KB28.61KB▼ 74.56%