78% tpg-redirect

Code Review | TPG Redirect

WordPress plugin TPG Redirect scored78%from 54 tests.

About plugin

  • Plugin page: tpg-redirect
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 22, 2013
  • Latest release: Aug 18, 2023
  • Number of updates: 33
  • Update frequency: every 111.5 days
  • Top authors: cswaim (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,009 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.19ms] Passed 4 tests

A check of server-side resources used by TPG Redirect
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.25 ▼3.59
Dashboard /wp-admin3.41 ▲0.1149.62 ▼1.12
Posts /wp-admin/edit.php3.52 ▲0.1749.70 ▲0.50
Add New Post /wp-admin/post-new.php5.99 ▲0.1095.91 ▼0.40
Media Library /wp-admin/upload.php3.33 ▲0.1033.93 ▲0.34
TPG Redirect /wp-admin/options-general.php?page=tpg-redirect-settings3.3230.77

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for TPG Redirect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.79 ▼0.581.76 ▲0.1438.42 ▼5.71
Dashboard /wp-admin2,210 ▲254.85 ▼1.03109.01 ▲5.6843.37 ▲2.21
Posts /wp-admin/edit.php2,093 ▲42.09 ▲0.0339.24 ▲1.9735.54 ▲3.53
Add New Post /wp-admin/post-new.php1,517 ▼217.67 ▼5.68596.99 ▼78.1850.39 ▼11.45
Media Library /wp-admin/upload.php1,392 ▲74.22 ▲0.0495.32 ▼3.6842.39 ▼5.05
TPG Redirect /wp-admin/options-general.php?page=tpg-redirect-settings9591.8732.9829.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

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
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/tpg-redirect/inc/doc-text.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tpg-redirect/tpg-redirect.php:35
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/class-wp-upgrader.php' (include_path='.:/usr/share/php') in wp-content/plugins/tpg-redirect/inc/class-tpg-upgrader.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/tpg-redirect/templates/template-default.php:12
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/class-wp-upgrader.php): failed to open stream: No such file or directory in wp-content/plugins/tpg-redirect/inc/class-tpg-upgrader.php on line 6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tpg-redirect/inc/class-tpg-upgrader.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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: Please add an image for screenshot #1 (Admin page)
You can take inspiration from this readme.txt

tpg-redirect/tpg-redirect.php Passed 13 tests

Analyzing the main PHP file in "TPG Redirect" version 1.0.8
52 characters long description:
Redirects to specified page when user not logged in.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin828 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP12179669720
CSS12119104
JavaScript1364

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity7.38
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods50
▷ Static methods612.00%
▷ Public methods50100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/tabs.png2.79KB2.25KB▼ 19.37%