78% restrict-page-parents

Code Review | Restrict Page Parents

WordPress plugin Restrict Page Parents scored78%from 54 tests.

About plugin

  • Plugin page: restrict-page-par...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-3.6
  • WordPress version: 6.3.1
  • First release: Mar 29, 2013
  • Latest release: Jun 18, 2013
  • Number of updates: 23
  • Update frequency: every 3.6 days
  • Top authors: tom.maitland (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /6,662 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.26MB] [CPU: ▼16.14ms] Passed 4 tests

An overview of server-side resources used by Restrict Page Parents
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.07 ▲0.69
Dashboard /wp-admin3.07 ▼0.2333.40 ▼16.77
Posts /wp-admin/edit.php3.21 ▼0.1533.36 ▼20.78
Add New Post /wp-admin/post-new.php5.32 ▼0.5771.24 ▼27.69
Media Library /wp-admin/upload.php3.14 ▼0.0949.12 ▲11.46
Restrict Page Parents /wp-admin/options-general.php?page=rpp3.0532.39

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Restrict Page Parents
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.47 ▲0.082.01 ▲0.1643.97 ▼3.95
Dashboard /wp-admin2,205 ▲285.66 ▼0.0493.38 ▲3.3441.92 ▼3.89
Posts /wp-admin/edit.php2,110 ▲102.01 ▼0.0036.40 ▼2.3933.82 ▼2.66
Add New Post /wp-admin/post-new.php1,533 ▼1417.39 ▼5.66681.75 ▼4.6955.58 ▲1.40
Media Library /wp-admin/upload.php1,410 ▲104.23 ▲0.0597.53 ▼7.8942.99 ▼3.44
Restrict Page Parents /wp-admin/options-general.php?page=rpp1,1192.0522.2425.77

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 54 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rpp
    • > Notice in wp-content/plugins/restrict-page-parents/rpp-options.php+140
    Trying to access array offset on value of type bool
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rpp
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
    • > GET request to /wp-admin/options-general.php?page=rpp
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=rpp
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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 screen_icon() in wp-content/plugins/restrict-page-parents/rpp-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/restrict-page-parents/restrict-page-parents.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === restrict-page-parents === )
You can look at the official readme.txt

restrict-page-parents/restrict-page-parents.php 92% from 13 tests

The entry point to "Restrict Page Parents" version 1.1.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected419 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP322294385
JavaScript113334

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin