68% restrict-wp-pages-with-redirect

Code Review | Restrict WP Pages With Redirect

WordPress plugin Restrict WP Pages With Redirect scored68%from 54 tests.

About plugin

  • Plugin page: restrict-wp-pages...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.2
  • WordPress version: 6.3.1
  • First release: Jun 2, 2015
  • Latest release: Jun 2, 2015
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: optimistic_shekhar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,327 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
Installer ran successfully

Server metrics [RAM: ▼1.23MB] [CPU: ▼40.93ms] Passed 4 tests

An overview of server-side resources used by Restrict WP Pages With Redirect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.75 ▼0.7214.23 ▼25.14
Dashboard /wp-admin2.79 ▼0.5217.61 ▼36.13
Posts /wp-admin/edit.php2.79 ▼0.5715.07 ▼28.90
Add New Post /wp-admin/post-new.php2.79 ▼3.1015.33 ▼73.55
Media Library /wp-admin/upload.php2.79 ▼0.4513.27 ▼20.81

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Restrict WP Pages With Redirect
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.174.74 ▲2.9443.11 ▼1.64
Dashboard /wp-admin2,203 ▲185.81 ▼0.2396.99 ▼14.3938.23 ▼4.25
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0833.16 ▼0.9534.08 ▲0.33
Add New Post /wp-admin/post-new.php1,542 ▲718.19 ▼5.11633.09 ▼52.5860.97 ▲5.90
Media Library /wp-admin/upload.php1,382 ▼34.19 ▼0.0293.31 ▼8.3843.38 ▼1.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/restrict-wp-pages-with-redirect/settings.php+61
    Trying to get property 'ID' of non-object
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • 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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/restrict-wp-pages-with-redirect/index.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restrict-wp-pages-with-redirect/settings.php:14

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: redirect pages, wordpress, restrict pages

restrict-wp-pages-with-redirect/index.php 92% from 13 tests

Analyzing the main PHP file in "Restrict WP Pages With Redirect" version 1.0.0
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("restrict-wp-pages-with-redirect.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin76 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2381476

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin