10% postcodes4u-address-finder

Code Review | Postcodes4U Address Finder

WordPress plugin Postcodes4U Address Finder scored10%from 54 tests.

About plugin

  • Plugin page: postcodes4u-addre...
  • Plugin version: 1.5.31.0
  • PHP compatiblity: 5.6.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 19, 2014
  • Latest release: Aug 15, 2023
  • Number of updates: 98
  • Update frequency: every 35.1 days
  • Top authors: sandrac (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

600+ active /12,629 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲0.59MB] [CPU: ▲0.38ms] Passed 4 tests

Server-side resources used by Postcodes4U Address Finder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6043.44 ▼0.70
Dashboard /wp-admin3.90 ▲0.5953.21 ▲1.47
Posts /wp-admin/edit.php4.01 ▲0.6548.28 ▼0.71
Add New Post /wp-admin/post-new.php6.48 ▲0.5990.52 ▲1.46
Media Library /wp-admin/upload.php3.82 ▲0.5939.86 ▲8.38
Postcodes4U /wp-admin/options-general.php?page=pc4u-options3.8035.05

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
can_compress_scripts
postcodes4u_page_title
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
postcodes4u_page_id
postcodes4u_page_name

Browser metrics Passed 4 tests

Checking browser requirements for Postcodes4U Address Finder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7613.39 ▼0.911.94 ▼0.0343.73 ▼5.65
Dashboard /wp-admin2,207 ▲225.87 ▲0.02108.69 ▼9.2342.18 ▼0.97
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.0535.38 ▼0.6430.92 ▼2.46
Add New Post /wp-admin/post-new.php1,536 ▲822.93 ▼0.02568.70 ▼107.5759.02 ▼1.32
Media Library /wp-admin/upload.php1,386 ▼24.30 ▲0.1398.96 ▼1.7541.98 ▼3.70
Postcodes4U /wp-admin/options-general.php?page=pc4u-options1,1862.0322.9428.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/postcodes4u-address-finder/includes/gf_integration.php
    • > /wp-content/plugins/postcodes4u-address-finder/includes/cf7_integration.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/postcodes4u-address-finder/includes/display-functions.php:156
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/postcodes4u-address-finder/postcodes4U.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/postcodes4u-address-finder/includes/woo_integration.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/postcodes4u-address-finder/includes/scripts.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/postcodes4u-address-finder/includes/admin-page.php:416

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Simple interface to add your Postcodes4U details), #2 (Works with ContactForm7 and GravityForms), #3 (Works with WooCommerce Checkout and Account Pages), #4 (Easy setup for postcode Lookup in ContactForm7), #5 (Easy setup for postcode Lookup in GravityForms), #6 (Compatable with GravityForms 2.5.x - 2.7.x), #7 (Includes Our own Contact form with Postcodes4U Postcode Lookup), #8 (In all cases, like WooCommerce, use our Simple address look up for for Postcodes4U), #9 (With Simple address selection)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

postcodes4u-address-finder/postcodes4U.php 85% from 13 tests

The main file in "Postcodes4U Address Finder" v. 1.5.31.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("postcodes4u-address-finder.php" instead of "postcodes4U.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "3.0")

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin6,577 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript26851,0304,072
PHP124535832,412
CSS2321893

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 128)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity81.00
▷ Minimum class complexity7.00
▷ Maximum class complexity225.00
Average method complexity6.71
▷ Minimum method complexity1.00
▷ Maximum method complexity128.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods921.43%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.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
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
PC4u_1_5.png79.03KB30.84KB▼ 60.97%