63% cogwork

Code Review | CogWork

WordPress plugin CogWork scored63%from 54 tests.

About plugin

  • Plugin page: cogwork
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Dec 8, 2015
  • Latest release: Nov 23, 2023
  • Number of updates: 48
  • Update frequency: every 60.6 days
  • Top authors: cogwork (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,628 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.88MB] [CPU: ▼56.56ms] Passed 4 tests

Server-side resources used by CogWork
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.356.67 ▼43.06
Dashboard /wp-admin2.14 ▼1.178.59 ▼52.49
Posts /wp-admin/edit.php2.14 ▼1.238.69 ▼41.05
Add New Post /wp-admin/post-new.php2.14 ▼3.768.99 ▼89.63
Media Library /wp-admin/upload.php2.14 ▼1.109.34 ▼23.13
CogWork /wp-admin/options-general.php?page=cogwork_settings2.148.88

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for CogWork
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲2214.70 ▲0.471.58 ▼0.1735.96 ▼7.52
Dashboard /wp-admin2,199 ▲195.62 ▼0.0092.07 ▼3.9140.31 ▼1.81
Posts /wp-admin/edit.php2,107 ▲71.95 ▼0.0639.68 ▲3.7538.96 ▲1.49
Add New Post /wp-admin/post-new.php6,200 ▲4,67419.23 ▼4.01943.81 ▲327.7438.69 ▼13.17
Media Library /wp-admin/upload.php1,404 ▲74.25 ▲0.0996.40 ▼1.8640.79 ▼2.79
CogWork /wp-admin/options-general.php?page=cogwork_settings1,0122.0023.8129.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function WP_User_Query::query was called incorrectly. User queries should not be run before the plugins_loaded hook. Please see Debugging in WordPress for more information. (This message was added in version 6.1.1.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% 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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=cogwork_settings
    • > User notice in wp-includes/functions.php+5905
    Function WP_User_Query::query was called incorrectly. User queries should not be run before the plugins_loaded hook. Please see Debugging in WordPress for more information. (This message was added in version 6.1.1.)

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 take a closer look at the following
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cogwork/php-scripts/shortcodes.php
    • > /wp-content/plugins/cogwork/php-scripts/mediabutton.php
    • > /wp-content/plugins/cogwork/cogwork.php
    • > /wp-content/plugins/cogwork/php-scripts/settings.php
    • > /wp-content/plugins/cogwork/php-scripts/gutenbergblock.php
    • > /wp-content/plugins/cogwork/php-scripts/login.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'CW_PHP_CLASSES_DIRcwConnector.php' (include_path='.:/usr/share/php') in wp-content/plugins/cogwork/php-classes/cwShortcode.php on line 2
    • > PHP Warning
      require_once(CW_PHP_CLASSES_DIRcwConnector.php): failed to open stream: No such file or directory in wp-content/plugins/cogwork/php-classes/cwShortcode.php on line 2
    • > PHP Warning
      Use of undefined constant CW_PHP_CLASSES_DIR - assumed 'CW_PHP_CLASSES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/cogwork/php-classes/cwShortcode.php on line 2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: minaaktiviteter, events, payment, customers, registration...

cogwork/cogwork.php Passed 13 tests

"CogWork" version 1.8.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
99 characters long description:
Enables shortcodes that loads and displays content from CogWork (MinaAktiviteter/Dans.se/Idrott.se)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected6,281 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JSON2004,547
PHP174732731,270
JavaScript49695355
PO File12942109

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity22.18
▷ Minimum class complexity3.00
▷ Maximum class complexity60.00
Average method complexity5.76
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods49
▷ Static methods2142.86%
▷ Public methods2959.18%
▷ Protected methods00.00%
▷ Private methods2040.82%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin