10% primary-redirect

Code Review | Primary Redirect

WordPress plugin Primary Redirect scored10%from 54 tests.

About plugin

  • Plugin page: primary-redirect
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2012
  • Latest release: Jan 11, 2013
  • Number of updates: 7
  • Update frequency: every 19.7 days
  • Top authors: m_uysl (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,982 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Parse error in wp-content/plugins/primary-redirect/primary-redirect.php+145
    syntax error, unexpected 'new' (T_NEW)

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.53ms] Passed 4 tests

Analyzing server-side resources used by Primary Redirect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.70 ▼1.16
Dashboard /wp-admin3.31 ▲0.0046.17 ▲1.06
Posts /wp-admin/edit.php3.36 ▲0.0046.40 ▼3.91
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.36 ▼21.73
Media Library /wp-admin/upload.php3.23 ▲0.0035.01 ▼3.31

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Primary Redirect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.441.68 ▼0.0140.81 ▲0.66
Dashboard /wp-admin2,209 ▲204.81 ▼0.14104.89 ▼14.8539.45 ▼5.20
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0238.81 ▼3.7335.08 ▼0.57
Add New Post /wp-admin/post-new.php1,546 ▲1118.16 ▼5.01592.58 ▼27.3178.10 ▲23.17
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0095.60 ▼7.4541.03 ▼3.71

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Parse error
      syntax error, unexpected 'new' (T_NEW) in wp-content/plugins/primary-redirect/primary-redirect.php on line 145

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png)
You can take inspiration from this readme.txt

primary-redirect/primary-redirect.php 92% from 13 tests

Analyzing the main PHP file in "Primary Redirect" version 1.0
Please make the necessary changes and fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

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
No dangerous file extensions were detected120 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1303483
PO File26737

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png19.21KB7.93KB▼ 58.71%
screenshot-1.png5.09KB2.86KB▼ 43.80%