78% post-worktime-logger

Code Review | Post Worktime Logger

WordPress plugin Post Worktime Logger scored 78% from 53 tests.

About plugin

  • Plugin page: post-worktime-logger
  • Plugin version: 1.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3.1-5.1
  • WordPress version: 5.8.1
  • First release: Oct 10, 2016
  • Latest release: Mar 17, 2019
  • Number of updates: 39
  • Update frequency: every 22.8 days
  • Top authors: filme-blog (100%)

Code review

53 tests

User reviews

1 review

Install metrics

60+ active / 1,880 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.16MB] [CPU: ▼985.41ms] Passed 4 tests

Server-side resources used by Post Worktime Logger
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.2439.31 ▲19.41
Dashboard /wp-admin3.20 ▲0.1550.45 ▲9.55
Posts /wp-admin/edit.php3.31 ▲0.2148.10 ▲1.73
Add New Post /wp-admin/post-new.php5.57 ▲0.1494.21 ▼3,947.43
Media Library /wp-admin/upload.php3.14 ▲0.1433.79 ▼5.47
Worktime Logger /wp-admin/admin.php?page=post-worktime-logger-statistics3.1230.04
Settings /wp-admin/admin.php?page=post-worktime-logger-settings3.0926.43

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 1 new option
New WordPress options
widget_pwl_frontend_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Worktime Logger
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,797 ▲19116.28 ▲0.4312.04 ▲3.0446.45 ▲2.70
Dashboard /wp-admin2,969 ▲1195.88 ▲0.05151.11 ▲19.71101.77 ▲1.59
Posts /wp-admin/edit.php2,765 ▲592.70 ▲0.0164.91 ▼1.8294.24 ▲7.55
Add New Post /wp-admin/post-new.php1,908 ▲25519.15 ▲0.28362.70 ▲4.00119.20 ▲7.06
Media Library /wp-admin/upload.php1,811 ▲395.10 ▲0.09141.32 ▼32.90113.19 ▲4.77
Worktime Logger /wp-admin/admin.php?page=post-worktime-logger-statistics9912.9857.4048.36
Settings /wp-admin/admin.php?page=post-worktime-logger-settings1,1872.1157.2772.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_pwl_frontend_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=post-worktime-logger-settings
    • > Warning in wp-content/plugins/post-worktime-logger/settings.php+225
    Use of undefined constant WP_KEYWORD_MONITOR_TEXT_DOMAIN - assumed 'WP_KEYWORD_MONITOR_TEXT_DOMAIN' (this will throw an Error in a future version of PHP)

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/post-worktime-logger/widget.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/post-worktime-logger/widget.php:12

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4, #5, #6, #7 in post-worktime-logger/assets to your readme.txt
You can take inspiration from this readme.txt

post-worktime-logger/post-worktime-logger.php Passed 13 tests

The principal PHP file in "Post Worktime Logger" v. 1.5.3 is loaded by WordPress automatically on each request
45 characters long description:
A plugin to track the worktime for each post.

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
There were no executable files found in this plugin1,533 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP3115144641
PO File7234468605
JavaScript22134122
Markdown1570112
CSS14017
YAML13012
Dockerfile14010
XML12108
JSON1006

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity19.00
▷ Minimum class complexity15.00
▷ Maximum class complexity23.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1275.00%
▷ Anonymous functions425.00%
Constants6
▷ Global constants116.67%
▷ Class constants583.33%
▷ Public constants5100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin