10% pf404-for-petfinder

Code Review | PF404 for PetFinder

WordPress plugin PF404 for PetFinder scored10%from 54 tests.

About plugin

  • Plugin page: pf404-for-petfinder
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Jul 7, 2017
  • Latest release: Jul 7, 2017
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: brohar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /673 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/pf404-for-petfinder/plugin.php+94
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.91MB] [CPU: ▼53.00ms] Passed 4 tests

Analyzing server-side resources used by PF404 for PetFinder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.72 ▼38.90
Dashboard /wp-admin2.10 ▼1.207.02 ▼44.13
Posts /wp-admin/edit.php2.11 ▼1.257.41 ▼42.40
Add New Post /wp-admin/post-new.php2.11 ▼3.796.74 ▼86.55
Media Library /wp-admin/upload.php2.11 ▼1.137.36 ▼26.43
PF404 for PetFinder /wp-admin/options-general.php?page=pf4042.117.38

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: 1 new table, 6 new options
New tables
wp_petfinder_404
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

PF404 for PetFinder: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.45 ▲0.011.67 ▼0.5643.10 ▲0.18
Dashboard /wp-admin2,226 ▲384.87 ▼1.02109.22 ▲4.3137.76 ▼1.16
Posts /wp-admin/edit.php2,109 ▲382.05 ▲0.0241.01 ▲5.1237.20 ▲1.18
Add New Post /wp-admin/post-new.php1,547 ▲1823.21 ▲5.06639.10 ▲0.6066.83 ▲6.15
Media Library /wp-admin/upload.php1,408 ▲204.26 ▲0.07110.33 ▲9.7947.77 ▲3.60
PF404 for PetFinder /wp-admin/options-general.php?page=pf4049052.0624.4928.84

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/pf404-for-petfinder/plugin.php+94
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pf404
    • > Notice in wp-content/plugins/pf404-for-petfinder/settings.php+178
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pf404-for-petfinder/plugin.php
    • > /wp-content/plugins/pf404-for-petfinder/settings.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/pf404-for-petfinder/page-404.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
6 plugin tags: custom 404, petfinder, 404, not found, pets...

pf404-for-petfinder/plugin.php 92% from 13 tests

The main PHP script in "PF404 for PetFinder" version 0.1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pf404-for-petfinder.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin416 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP59130388
CSS10026
JavaScript22122

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.27
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods323.08%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 1.69MB with 1.12MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png1,695.40KB386.76KB▼ 77.19%
screenshot-2.png34.88KB15.51KB▼ 55.54%