78% dropcaps-shortcodes-and-widget

Code Review | Dropcaps Shortcode and Widget

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

About plugin

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

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /8,824 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼2.20ms] Passed 4 tests

Server-side resources used by Dropcaps Shortcode and Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1535.87 ▼1.10
Dashboard /wp-admin3.48 ▲0.1447.46 ▼10.82
Posts /wp-admin/edit.php3.53 ▲0.1852.33 ▲7.93
Add New Post /wp-admin/post-new.php6.02 ▲0.1484.81 ▼4.77
Media Library /wp-admin/upload.php3.36 ▲0.1339.30 ▲7.90

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 113 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_otw_shortcode_widget
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Dropcaps Shortcode and Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.39 ▲0.041.78 ▲0.2541.90 ▲2.56
Dashboard /wp-admin2,215 ▲354.90 ▼0.6985.31 ▼3.7272.35 ▲31.25
Posts /wp-admin/edit.php2,141 ▲442.31 ▲0.3341.26 ▲6.0037.43 ▼0.44
Add New Post /wp-admin/post-new.php6,395 ▲4,85827.95 ▲9.46890.38 ▲280.1340.10 ▼20.03
Media Library /wp-admin/upload.php1,435 ▲354.52 ▲0.2898.27 ▼5.3767.63 ▲21.36

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • 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)
Everything seems fine, however 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-mailhide.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/dropcaps-shortcodes-and-widget/otw_content_manager.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_components/otw_shortcode/otw_shortcode.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_dcsw_settings.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_components/otw_shortcode/widgets/otw_shortcode_widget.class.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_post() in wp-content/plugins/dropcaps-shortcodes-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 __() in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_labels/otw_dcsw_shortcode_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_esc_text() in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_dcsw_help.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_components/otw_form/otw_form.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Shortcodes' not found in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_components/otw_shortcode/shortcodes/otw_shortcode_dropcap.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/dropcaps-shortcodes-and-widget/include/otw_components/otw_validator/otw_validator.class.php:2

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)
No browser errors were detected

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 your attention:
  • Screenshots: These screenshots do not have images: #1 (WYSIWYG page/post editor button), #2 (OTW Shortcode Widget), #3 (Dropcaps Options), #4 (Front-end)
The official readme.txt might help

dropcaps-shortcodes-and-widget/otw_content_manager.php 92% from 13 tests

The main PHP file in "Dropcaps Shortcode and Widget" ver. 1.8 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dropcaps-shortcodes-and-widget.php" instead of "otw_content_manager.php")

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
Everything looks great! No dangerous files found in this plugin11,102 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
CSS124701035,222
PHP221,1639013,764
JavaScript145061322,061
SVG30038
JSON10017

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity61.50
▷ Minimum class complexity1.00
▷ Maximum class complexity173.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods136
▷ Static methods2216.18%
▷ Public methods10375.74%
▷ Protected methods2719.85%
▷ Private methods64.41%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
35 compressed PNG files occupy 0.21MB
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_shortcode/images/toggle-icon.png0.12KB0.11KB▼ 5.04%
include/otw_components/otw_form/img/colorpicker/colorpicker_hex.png0.52KB0.42KB▼ 19.92%
include/otw_components/otw_shortcode/images/read-more.png0.17KB0.22KB0.00%
images/otw-sbm-icon.png0.13KB0.14KB0.00%