68% pasa-link-redirect

Code Review | PASA Link Redirect

WordPress plugin PASA Link Redirect scored68%from 54 tests.

About plugin

  • Plugin page: pasa-link-redirect
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 23, 2020
  • Latest release: Sep 23, 2020
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: sahiljb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /443 total downloads

Benchmarks

Plugin footprint 65% 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.19MB] [CPU: ▼10.70ms] Passed 4 tests

Analyzing server-side resources used by PASA Link Redirect
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.83 ▼0.6315.39 ▼26.57
Dashboard /wp-admin3.32 ▲0.0245.89 ▼2.85
Posts /wp-admin/edit.php3.18 ▼0.1732.89 ▼13.39
Add New Post /wp-admin/post-new.php5.92 ▲0.0496.64 ▲0.01
Media Library /wp-admin/upload.php3.24 ▲0.0233.02 ▲1.62

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: 1 new table, 6 new options
New tables
wp_pasa_link_redirector
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for PASA Link Redirect
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲19613.54 ▼0.837.78 ▲5.9140.41 ▼4.38
Dashboard /wp-admin2,229 ▲544.92 ▼0.04108.74 ▼1.0437.30 ▼2.50
Posts /wp-admin/edit.php2,115 ▲402.04 ▲0.0739.23 ▲0.5435.33 ▼1.63
Add New Post /wp-admin/post-new.php1,548 ▲3423.27 ▲5.79667.97 ▲27.2352.73 ▼11.28
Media Library /wp-admin/upload.php1,405 ▲174.29 ▲0.1397.62 ▼6.4943.95 ▲2.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_pasa_link_redirector
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pasa-link-redirect/public/partials/pasa-link-redirect-and-manager-public-display.php
    • > /wp-content/plugins/pasa-link-redirect/admin/partials/pasa-link-redirect-and-manager-admin-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/pasa-link-redirect/admin/partials/admin-support-page.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pasa-link-redirect/admin/partials/admin-settings-page.php:1

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === pasa-link-redirect === )
The official readme.txt might help

pasa-link-redirect/pasa-link-redirect-and-manager.php 85% from 13 tests

The main PHP script in "PASA Link Redirect" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("pasa-link-redirect.php" instead of "pasa-link-redirect-and-manager.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin491 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14173544457
JavaScript2102730
CSS31144

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.14
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods39
▷ Static methods12.56%
▷ Public methods3487.18%
▷ Protected methods00.00%
▷ Private methods512.82%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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 images were found in this plugin