83% cogwork

Code Review | CogWork

WordPress plugin CogWork scored 83% from 54 tests.

About plugin

  • Plugin page: cogwork
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.8.1
  • First release: Dec 8, 2015
  • Latest release: Aug 5, 2021
  • Number of updates: 42
  • Update frequency: every 49.2 days
  • Top authors: cogwork (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active / 1,879 total downloads

Benchmarks

Plugin footprint Passed 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.08MB] [CPU: ▲4.88ms] Passed 4 tests

Server-side resources used by CogWork
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1838.59 ▲15.42
Dashboard /wp-admin3.13 ▲0.0745.04 ▲2.06
Posts /wp-admin/edit.php3.24 ▲0.1346.66 ▲2.05
Add New Post /wp-admin/post-new.php5.49 ▲0.052,457.91 ▲1,801.44
Media Library /wp-admin/upload.php3.07 ▲0.0733.18 ▼0.02
CogWork /wp-admin/options-general.php?page=cogwork_settings3.0532.79

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for CogWork
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,683 ▲8716.14 ▲0.659.00 ▲0.5549.69 ▼5.59
Dashboard /wp-admin2,978 ▲476.09 ▲0.15150.34 ▼0.70116.00 ▼3.87
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0166.21 ▼8.7596.08 ▲6.39
Add New Post /wp-admin/post-new.php1,695 ▲1218.38 ▼0.36397.22 ▲9.03139.16 ▲17.57
Media Library /wp-admin/upload.php1,812 ▲55.04 ▼0.08158.74 ▼0.07129.47 ▲8.12
CogWork /wp-admin/options-general.php?page=cogwork_settings1,1682.0965.7893.46

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cogwork_settings
    • > Notice in wp-content/plugins/cogwork/php-classes/cwOptions.php+53
    Trying to access array offset on value of type bool

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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cogwork/php-scripts/settings.php
    • > /wp-content/plugins/cogwork/cogwork.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cogwork/php-scripts/shortcodes.php:6
    • > 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-scripts/gutenbergblock.php on line 3
    • > 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
      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
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cogwork/php-scripts/mediabutton.php:3
    • > PHP Warning
      require_once(CW_PHP_CLASSES_DIRcwConnector.php): failed to open stream: No such file or directory in wp-content/plugins/cogwork/php-scripts/gutenbergblock.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'CW_PHP_CLASSES_DIRcwConnector.php' (include_path='.:/usr/share/php') in wp-content/plugins/cogwork/php-scripts/gutenbergblock.php on line 3
    • > 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

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: dansse, customers, members, minaaktiviteter, booking...

cogwork/cogwork.php Passed 13 tests

"CogWork" version 1.7.3'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 detected5,800 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JSON2004,547
PHP15299197866
JavaScript49695355
PO File18932

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 complexity17.20
▷ Minimum class complexity3.00
▷ Maximum class complexity38.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods36
▷ Static methods1850.00%
▷ Public methods2363.89%
▷ Protected methods00.00%
▷ Private methods1336.11%
Functions10
▷ Named functions10100.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