94% eth-redirect-to-latest-post

Code Review | ETH Redirect to Latest Post

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

About plugin

  • Plugin page: eth-redirect-to-l...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7
  • WordPress version: 5.8.1
  • First release: May 17, 2016
  • Latest release: Feb 24, 2021
  • Number of updates: 14
  • Update frequency: every 124.6 days
  • Top authors: ethitter (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active / 1,696 total downloads

Benchmarks

Plugin footprint Passed 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: ▼139.86ms] 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 /2.86 ▲0.1434.65 ▲15.95
Dashboard /wp-admin3.08 ▲0.0346.57 ▼3.00
Posts /wp-admin/edit.php3.13 ▲0.0346.09 ▲0.53
Add New Post /wp-admin/post-new.php5.44 ▲0.0193.38 ▼555.37
Media Library /wp-admin/upload.php3.03 ▲0.0231.90 ▼1.60

Server storage [IO: ▲0.02MB] [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, no new options

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 /3,703 ▲10715.97 ▲0.449.54 ▼1.4650.14 ▲0.03
Dashboard /wp-admin2,992 ▲556.01 ▲0.04146.62 ▼13.34111.12 ▼2.57
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0075.20 ▼10.9789.27 ▼5.98
Add New Post /wp-admin/post-new.php1,672 ▼2,05218.79 ▲3.50393.51 ▼82.15107.52 ▼2.26
Media Library /wp-admin/upload.php1,748 ▼595.00 ▼0.03154.61 ▲5.91126.95 ▲15.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

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 93% 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 post, redirect, redirect post, redirect latest, latest

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

The entry point to "ETH Redirect to Latest Post" version 0.3 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")
  • Text Domain: Please use dashes and lowercase characters for text domains

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 detected121 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP244136121

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.40
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected