78% postcodex-lookup

Code Review | Postcodex Lookup

WordPress plugin Postcodex Lookup scored78%from 54 tests.

About plugin

  • Plugin page: postcodex-lookup
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.3-5.8
  • WordPress version: 6.3.1
  • First release: Oct 27, 2020
  • Latest release: Jul 21, 2021
  • Number of updates: 11
  • Update frequency: every 24.3 days
  • Top authors: postcodex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /413 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.49MB] [CPU: ▼14.83ms] Passed 4 tests

A check of server-side resources used by Postcodex Lookup
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.61 ▼4.72
Dashboard /wp-admin3.53 ▲0.2349.63 ▼3.58
Posts /wp-admin/edit.php3.64 ▲0.2949.51 ▲1.89
Add New Post /wp-admin/post-new.php3.38 ▼2.5135.76 ▼52.89
Media Library /wp-admin/upload.php3.45 ▲0.2237.52 ▲5.63

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Postcodex Lookup: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8014.47 ▲0.091.82 ▼0.1141.42 ▼2.73
Dashboard /wp-admin2,218 ▲304.90 ▲0.0899.53 ▼17.9671.84 ▲25.73
Posts /wp-admin/edit.php2,107 ▲181.99 ▼0.1139.65 ▲3.2836.23 ▼3.76
Add New Post /wp-admin/post-new.php6,537 ▲5,00422.56 ▼0.65865.46 ▲195.4055.85 ▼5.16
Media Library /wp-admin/upload.php1,397 ▲154.21 ▲0.0596.50 ▼3.1268.43 ▲24.63

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/postcodex-lookup/includes/autoload.php
    • > /wp-content/plugins/postcodex-lookup/postcodex-lookup.php
    • > /wp-content/plugins/postcodex-lookup/includes/class-index.php
    • > /wp-content/plugins/postcodex-lookup/includes/class-assets.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/postcodex-lookup/includes/class-rest.php:19
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/postcodex-lookup/includes/class-rest.php on line 11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/postcodex-lookup/includes/class-rest.php on line 11
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/postcodex-lookup/includes/class-rest.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
No tags were detected

postcodex-lookup/postcodex-lookup.php 92% from 13 tests

"Postcodex Lookup" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin16,225 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript124,4945,66515,034
PHP92906161,128
CSS411463

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity22.83
▷ Minimum class complexity6.00
▷ Maximum class complexity39.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods72
▷ Static methods1013.89%
▷ Public methods6286.11%
▷ Protected methods1013.89%
▷ Private methods00.00%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/postcodex-icon.png0.56KB0.58KB0.00%