84% tock-widget

Code Review | Tock Widget

WordPress plugin Tock Widget scored84%from 54 tests.

About plugin

  • Plugin page: tock-widget
  • Plugin version: 1.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2019
  • Latest release: Feb 6, 2023
  • Number of updates: 11
  • Update frequency: every 110.4 days
  • Top authors: tockengineering (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /2,984 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.69ms] Passed 4 tests

An overview of server-side resources used by Tock Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.54 ▲1.05
Dashboard /wp-admin3.31 ▼0.0344.66 ▼18.03
Posts /wp-admin/edit.php3.37 ▲0.0149.46 ▼1.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.37 ▼10.16
Media Library /wp-admin/upload.php3.24 ▲0.0134.20 ▼1.14
Tock widget /wp-admin/tools.php?page=tock-widget/includes/tock-admin-page.php3.2030.83

Server storage [IO: ▲0.15MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for Tock Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲7914.37 ▼0.208.50 ▲6.5345.26 ▲8.06
Dashboard /wp-admin2,196 ▲165.54 ▼0.1383.01 ▼8.6636.06 ▼5.57
Posts /wp-admin/edit.php2,101 ▼21.97 ▲0.0236.78 ▼3.5030.47 ▼4.08
Add New Post /wp-admin/post-new.php6,368 ▲4,83927.75 ▲4.63888.43 ▲273.1453.88 ▼26.61
Media Library /wp-admin/upload.php1,404 ▲74.21 ▲0.0296.61 ▼15.6241.53 ▼2.55
Tock widget /wp-admin/tools.php?page=tock-widget/includes/tock-admin-page.php8081.9923.6624.56

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tock-widget/tock-plugin.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tock-widget/includes/tock-widget-functions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/tock-widget/includes/tock-admin-page.php:19

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)
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
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === tock-widget === )
The official readme.txt is a good inspiration

tock-widget/tock-plugin.php 92% from 13 tests

This is the main PHP file of "Tock Widget" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tock-widget.php" instead of "tock-plugin.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
Success! There were no dangerous files found in this plugin90 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3152369
JavaScript122421

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/assets/booknow.png14.71KB3.64KB▼ 75.26%