88% if-link-is-404broken-then-set-to-private

Code Review | if link is 404(broken), then set to private.

WordPress plugin if link is 404(broken), then set to private. scored 88% from 54 tests.

About plugin

  • Plugin page: if-link-is-404bro...
  • Plugin version: 1.0.2.20170918
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8.1-4.8.1
  • WordPress version: 5.9.2
  • First release: Sep 18, 2017
  • Latest release: Sep 30, 2017
  • Number of updates: 10
  • Update frequency: every 1.3 days
  • Top authors: yyano (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 497 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.10MB] [CPU: ▼304.83ms] Passed 4 tests

Server-side resources used by if link is 404(broken), then set to private.
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.1856.46 ▲4.36
Dashboard /wp-admin3.55 ▲0.1435.13 ▲2.53
Posts /wp-admin/edit.php3.78 ▲0.1338.02 ▲0.91
Add New Post /wp-admin/post-new.php6.17 ▼0.8085.86 ▼1,223.74
Media Library /wp-admin/upload.php3.43 ▲0.1326.30 ▲0.97
if link 404 /wp-admin/options-general.php?page=iflink4043.3723.45

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

if link is 404(broken), then set to private.: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,948 ▲19416.35 ▲0.689.58 ▲3.542.22 ▼0.42
Dashboard /wp-admin2,946 ▲856.15 ▼0.00126.06 ▼10.39158.44 ▼6.20
Posts /wp-admin/edit.php2,700 ▲93.23 ▼0.0165.27 ▲0.56136.55 ▼9.91
Add New Post /wp-admin/post-new.php1,779 ▲11817.26 ▼0.70425.84 ▲37.17181.34 ▲20.58
Media Library /wp-admin/upload.php1,708 ▲105.55 ▲0.01138.15 ▼8.78187.40 ▼3.09
if link 404 /wp-admin/options-general.php?page=iflink4041,0812.4154.57121.67

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
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=iflink404
    • > Notice in wp-content/plugins/if-link-is-404broken-then-set-to-private/admin/class-iflink404-admin.php+393
    Trying to access array offset on value of type bool

SRP 50% 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
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/if-link-is-404broken-then-set-to-private/admin/partials/iflink404-admin-display.php
    • > /wp-content/plugins/if-link-is-404broken-then-set-to-private/public/partials/iflink404-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: link check, if link is 404, link broken

if-link-is-404broken-then-set-to-private/iflink404.php 85% from 13 tests

The main PHP file in "if link is 404(broken), then set to private." ver. 1.0.2.20170918 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("if-link-is-404broken-then-set-to-private.php" instead of "iflink404.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin595 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11193597577
CSS22812
JavaScript24546

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.57
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods38
▷ Static methods37.89%
▷ Public methods3181.58%
▷ Protected methods00.00%
▷ Private methods718.42%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin