84% enable-cors

Code Review | Enable CORS

WordPress plugin Enable CORS scored84%from 54 tests.

About plugin

  • Plugin page: enable-cors
  • Plugin version: 1.1.9
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Mar 30, 2023
  • Latest release: Sep 7, 2023
  • Number of updates: 44
  • Update frequency: every 3.7 days
  • Top authors: devkabir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /8,510 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.59ms] Passed 4 tests

Server-side resources used by Enable CORS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.13 ▼7.33
Dashboard /wp-admin3.32 ▲0.0244.74 ▼4.44
Posts /wp-admin/edit.php3.43 ▲0.0847.08 ▼0.03
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.19 ▲8.47
Media Library /wp-admin/upload.php3.24 ▲0.0137.34 ▲1.46

Server storage [IO: ▲0.18MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • You have illegally modified 1 file (1.18KB) outside of "wp-content/plugins/enable-cors/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Enable CORS: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.29 ▼1.471.62 ▼0.1841.48 ▼3.88
Dashboard /wp-admin2,222 ▲405.91 ▲0.06108.32 ▲2.7841.52 ▲1.54
Posts /wp-admin/edit.php2,105 ▲162.03 ▼0.0239.76 ▲2.5135.95 ▲2.55
Add New Post /wp-admin/post-new.php1,555 ▲1918.40 ▼4.90594.34 ▼43.9753.87 ▲3.46
Media Library /wp-admin/upload.php1,407 ▲224.19 ▲0.0095.62 ▼5.0944.41 ▲1.31

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Trait 'Enable\\Cors\\Traits\\Singleton' not found in wp-content/plugins/enable-cors/src/Api/Support.php on line 13
    • > PHP Fatal error
      Trait 'Enable\\Cors\\Traits\\Singleton' not found in wp-content/plugins/enable-cors/src/Helpers/ToApi.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: error, cors, enable, axios, fix...

enable-cors/enable-cors.php Passed 13 tests

The main file in "Enable CORS" v. 1.1.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
Enable Cross-Origin Resource Sharing for any or specific origin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,369 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP232897221,357
JSON1005
JavaScript12115
CSS1001
HTML1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity10.93
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits3
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes866.67%
Methods78
▷ Static methods2835.90%
▷ Public methods6684.62%
▷ Protected methods00.00%
▷ Private methods1215.38%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants16
▷ Global constants531.25%
▷ Class constants1168.75%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected