84% eth-redirect-to-latest-post

Code Review | ETH Redirect to Latest Post

WordPress plugin ETH Redirect to Latest Post scored84%from 54 tests.

About plugin

  • Plugin page: eth-redirect-to-l...
  • Plugin version: 0.3.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.0
  • WordPress version: 6.3.1
  • First release: May 17, 2016
  • Latest release: Jul 1, 2022
  • Number of updates: 18
  • Update frequency: every 124.2 days
  • Top authors: ethitter (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active /3,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by ETH Redirect to Latest Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.74 ▼0.25
Dashboard /wp-admin3.33 ▼0.0147.64 ▼8.55
Posts /wp-admin/edit.php3.38 ▲0.0345.53 ▲1.12
Add New Post /wp-admin/post-new.php5.91 ▲0.0381.11 ▼10.32
Media Library /wp-admin/upload.php3.25 ▲0.0334.88 ▲0.85

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for ETH Redirect to Latest Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲5414.35 ▼0.001.60 ▼0.0441.09 ▼6.33
Dashboard /wp-admin2,192 ▲155.61 ▲0.0684.74 ▼4.8140.25 ▼0.50
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0334.83 ▼0.3335.69 ▼2.31
Add New Post /wp-admin/post-new.php1,526 ▼023.61 ▲0.05659.78 ▼33.9855.52 ▲3.74
Media Library /wp-admin/upload.php1,400 ▼04.23 ▼0.0394.37 ▼13.0942.51 ▼3.89

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

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/eth-redirect-to-latest-post/inc/class-eth-redirect-to-latest-post.php:84
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/eth-redirect-to-latest-post/inc/class-eth-redirect-to-latest-post.php:84

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

readme.txt Passed 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
5 plugin tags: latest, redirect latest, redirect, latest post, redirect post

eth-redirect-to-latest-post/eth-redirect-to-latest.php 92% from 13 tests

The entry point to "ETH Redirect to Latest Post" version 0.3.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("eth-redirect-to-latest-post.php" instead of "eth-redirect-to-latest.php")

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
Good job! No executable or dangerous file extensions detected129 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP245141129

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods1090.91%
▷ Protected methods00.00%
▷ Private methods19.09%
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
No PNG files were detected