83% talkhours

Code Review | TalkHours Widget

WordPress plugin TalkHours Widget scored83%from 54 tests.

About plugin

  • Plugin page: talkhours
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Jul 4, 2016
  • Latest release: Jul 4, 2016
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: mundanelunacy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,461 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.04ms] Passed 4 tests

Analyzing server-side resources used by TalkHours Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.55 ▼1.53
Dashboard /wp-admin3.33 ▼0.0243.32 ▼21.53
Posts /wp-admin/edit.php3.38 ▲0.0247.61 ▲3.86
Add New Post /wp-admin/post-new.php5.91 ▲0.0298.67 ▼3.23
Media Library /wp-admin/upload.php3.25 ▲0.0233.36 ▼1.85

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_talkhours_widget
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for TalkHours Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.28 ▼1.091.71 ▼0.3644.36 ▲0.01
Dashboard /wp-admin2,206 ▲155.85 ▲0.99108.37 ▲6.6442.61 ▲0.44
Posts /wp-admin/edit.php2,092 ▲32.05 ▼0.1239.06 ▲0.4434.99 ▲3.06
Add New Post /wp-admin/post-new.php1,547 ▲3318.43 ▲0.93587.82 ▲2.0474.59 ▲30.09
Media Library /wp-admin/upload.php1,391 ▲64.37 ▲0.1997.10 ▲3.2544.59 ▲4.34

Uninstaller [IO: ▲0.00MB] [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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_talkhours_widget
    • widget_recent-comments

Smoke tests 75% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/talkhours/widget.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/talkhours/trunk/widget.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === talkhours === )
  • Tags: You are using too many tags: 83 tag instead of maximum 10
You can look at the official readme.txt

talkhours/widget.php 85% from 13 tests

The entry point to "TalkHours Widget" version 0.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("talkhours.php" instead of "widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin160 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP282108160

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.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
No PNG images were found in this plugin