78% quotes-shortcode-and-widget

Code Review | Quotes Shortcode and Widget

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

About plugin

  • Plugin page: quotes-shortcode-...
  • Plugin version: 1.14
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9
  • WordPress version: 6.3.1
  • First release: May 30, 2014
  • Latest release: Apr 1, 2022
  • Number of updates: 21
  • Update frequency: every 136.3 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /13,473 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.02MB] [CPU: ▲4.53ms] Passed 4 tests

Analyzing server-side resources used by Quotes Shortcode and Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.48 ▲1.0251.80 ▲7.29
Dashboard /wp-admin4.34 ▲0.9956.06 ▼6.82
Posts /wp-admin/edit.php4.39 ▲1.0359.97 ▲10.41
Add New Post /wp-admin/post-new.php6.94 ▲1.0594.47 ▲7.22
Media Library /wp-admin/upload.php4.28 ▲1.0555.46 ▲20.89
License Manager /wp-admin/admin.php?page=otw-qtsw-lm4.30208.60
otwfcr /wp-admin/admin.php?page=otwfcr4.2343.92
Settings /wp-admin/admin.php?page=otw-qtsw-settings4.2342.24

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Quotes Shortcode and Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.35 ▼1.271.62 ▼0.3839.37 ▼4.64
Dashboard /wp-admin2,237 ▲855.07 ▼0.64110.58 ▲5.9872.83 ▲30.09
Posts /wp-admin/edit.php2,139 ▲502.34 ▲0.2935.70 ▲0.2834.67 ▲1.59
Add New Post /wp-admin/post-new.php6,392 ▲4,87327.85 ▲4.66916.72 ▲219.2337.19 ▼13.87
Media Library /wp-admin/upload.php1,437 ▲494.50 ▲0.25104.49 ▼0.9843.29 ▼2.98
License Manager /wp-admin/admin.php?page=otw-qtsw-lm9561.8727.1031.52
otwfcr /wp-admin/admin.php?page=otwfcr8161.8925.7420.95
Settings /wp-admin/admin.php?page=otw-qtsw-settings9212.0427.5438.13

Uninstaller [IO: ▲0.14MB] [DB: ▲0.01MB] 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 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_otw_shortcode_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_factory/views/action_message.php
    • > /wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-mailhide.php
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_shortcode/widgets/otw_shortcode_widget.class.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_factory/views/license_manager.php:3
    • > PHP Notice
      Undefined variable: return_url in wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_factory/views/action_message.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/quotes-shortcode-and-widget/include/otw_qtsw_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/quotes-shortcode-and-widget/otw_content_manager.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Shortcodes' not found in wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_shortcode/shortcodes/otw_shortcode_quote.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/quotes-shortcode-and-widget/include/otw_labels/otw_qtsw_factory_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_form/otw_form.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/quotes-shortcode-and-widget/include/otw_labels/otw_qtsw_shortcode_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/quotes-shortcode-and-widget/include/otw_components/otw_shortcode/otw_shortcode.class.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (WYSIWYG page/post editor button), #2 (OTW Shortcode Widget), #3 (Quotes Options), #4 (Front-end)
Please take inspiration from this readme.txt

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

"Quotes Shortcode and Widget" version 1.14's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("quotes-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 file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin17,012 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
CSS144721137,722
PHP271,4309224,503
SVG4002,709
JavaScript145061322,061
JSON10017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity76.33
▷ 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%
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

PNG files should be compressed to save space and minimize bandwidth usage
35 compressed PNG files occupy 0.30MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/otw_components/otw_shortcode/images/pattern-4.png0.09KB0.12KB0.00%
include/otw_components/otw_form/img/colorpicker/colorpicker_hex.png0.52KB0.42KB▼ 19.92%
include/otw_components/otw_form/img/colorpicker/colorpicker_rgb_b.png0.95KB0.76KB▼ 19.48%
include/otw_components/otw_shortcode/images/pattern-1.png0.08KB0.09KB0.00%
include/otw_components/otw_shortcode/images/sidebars-icon-placeholder.png0.15KB0.15KB0.00%