84% commonwp

Code Review | commonWP

WordPress plugin commonWP scored84%from 54 tests.

About plugin

  • Plugin page: commonwp
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.1
  • WordPress version: 6.3.1
  • First release: Sep 14, 2018
  • Latest release: Feb 24, 2019
  • Number of updates: 7
  • Update frequency: every 24.7 days
  • Top authors: dimadin (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /9,370 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.59ms] Passed 4 tests

Analyzing server-side resources used by commonWP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0839.37 ▼4.65
Dashboard /wp-admin3.39 ▲0.0445.72 ▼11.78
Posts /wp-admin/edit.php3.51 ▲0.1547.45 ▼3.02
Add New Post /wp-admin/post-new.php6.03 ▲0.1598.14 ▲1.09
Media Library /wp-admin/upload.php3.34 ▲0.1136.49 ▲3.04

Server storage [IO: ▲0.14MB] [DB: ▲0.04MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
commonwp_data
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for commonWP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲11213.72 ▼0.664.57 ▲2.3543.72 ▼4.33
Dashboard /wp-admin2,259 ▲715.88 ▲0.9094.25 ▼8.8743.01 ▲3.96
Posts /wp-admin/edit.php2,140 ▲541.95 ▼0.0635.85 ▼0.7334.69 ▲2.58
Add New Post /wp-admin/post-new.php1,606 ▲6422.20 ▲3.78628.04 ▼5.3435.30 ▼17.62
Media Library /wp-admin/upload.php1,448 ▲604.29 ▲0.1391.04 ▼12.1743.07 ▲0.16

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

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 everything seems fine, this is not an exhaustive test

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
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Trait 'dimadin\\WP\\Plugin\\commonWP\\Singleton' not found in wp-content/plugins/commonwp/inc/Process.php on line 25
    • > PHP Fatal error
      Trait 'dimadin\\WP\\Plugin\\commonWP\\Singleton' not found in wp-content/plugins/commonwp/inc/SRI.php on line 19
    • > PHP Fatal error
      Trait 'dimadin\\WP\\Plugin\\commonWP\\Singleton' not found in wp-content/plugins/commonwp/inc/Paths.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/commonwp/inc/WPCLI.php:53
    • > PHP Fatal error
      Trait 'dimadin\\WP\\Plugin\\commonWP\\Singleton' not found in wp-content/plugins/commonwp/inc/Main.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/commonwp/commonwp.php:70

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: performance, cdn, free cdn, jsdelivr, public cdn

commonwp/commonwp.php 92% from 13 tests

The main PHP script in "commonWP" version 1.1.0 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,017 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP235872,5671,913
XML31622104

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity15.24
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces2
Interfaces0
Traits1
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods125
▷ Static methods8971.20%
▷ Public methods11894.40%
▷ Protected methods75.60%
▷ Private methods00.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.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