84% wp-cors

Code Review | WP-CORS

WordPress plugin WP-CORS scored 84% from 54 tests.

About plugin

  • Plugin page: wp-cors
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 5, 2014
  • Latest release: Jul 28, 2023
  • Number of updates: 8
  • Update frequency: every 402.3 days
  • Top authors: tstephenson (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 29,904 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.14MB] [CPU: ▼10.29ms] Passed 4 tests

An overview of server-side resources used by WP-CORS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6219.72 ▼26.60
Dashboard /wp-admin3.33 ▲0.0347.52 ▼3.02
Posts /wp-admin/edit.php3.38 ▲0.0250.89 ▲2.12
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.87 ▼13.66
Media Library /wp-admin/upload.php3.25 ▲0.0233.49 ▲2.64
CORS /wp-admin/options-general.php?page=wp-cors3.2231.30

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-CORS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.20 ▼1.381.78 ▼0.2745.76 ▲2.68
Dashboard /wp-admin2,210 ▲224.89 ▲0.01106.61 ▼12.9939.47 ▼3.51
Posts /wp-admin/edit.php2,093 ▲12.02 ▲0.0239.76 ▼2.1636.77 ▲0.15
Add New Post /wp-admin/post-new.php1,540 ▲2623.08 ▲5.60620.73 ▼67.9254.76 ▼1.80
Media Library /wp-admin/upload.php1,392 ▲14.23 ▲0.08102.62 ▲0.9942.38 ▼0.23
CORS /wp-admin/options-general.php?page=wp-cors7692.0628.2526.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-cors/wp-cors.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: rest, ajax, cors

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

The main file in "WP-CORS" v. 0.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
60 characters long description:
Simply allows you to control which external domains may make

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected99 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP191379
Ant15020

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin