90% lh-multisite-cors

Code Review | LH Multisite CORS

WordPress plugin LH Multisite CORS scored90%from 54 tests.

About plugin

  • Plugin page: lh-multisite-cors
  • Plugin version: 1.02
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.0
  • WordPress version: 6.3.1
  • First release: Apr 14, 2016
  • Latest release: Jul 30, 2022
  • Number of updates: 9
  • Update frequency: every 255.3 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /10,699 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

This is a short check of server-side resources used by LH Multisite CORS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.0251.33 ▲1.42
Dashboard /wp-admin3.59 ▼0.0454.03 ▼10.10
Posts /wp-admin/edit.php3.70 ▲0.0252.08 ▲0.85
Add New Post /wp-admin/post-new.php6.17 ▲0.02102.81 ▲2.86
Media Library /wp-admin/upload.php3.51 ▲0.0239.27 ▲2.33

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for LH Multisite CORS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.122.02 ▲0.2443.42 ▼1.17
Dashboard /wp-admin2,195 ▲185.64 ▼0.03100.81 ▲7.4941.54 ▼0.99
Posts /wp-admin/edit.php2,097 ▼62.03 ▼0.0935.04 ▼1.4835.91 ▼1.27
Add New Post /wp-admin/post-new.php1,540 ▲1418.39 ▲0.65627.38 ▼18.2454.14 ▼7.99
Media Library /wp-admin/upload.php1,394 ▼64.09 ▼0.1399.00 ▼11.5845.82 ▼0.77

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

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 errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: ajax, cors, rest

lh-multisite-cors/lh-multisite-cors.php Passed 13 tests

The primary PHP file in "LH Multisite CORS" version 1.02 is used by WordPress to initiate all plugin functionality
84 characters long description:
Sets the CORS allow headers for requests between sites within your multisite network

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected127 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP212729127

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.71
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods555.56%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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