88% places

Code Review | Places

WordPress plugin Places scored 88% from 54 tests.

About plugin

  • Plugin page: places
  • Plugin version: 0.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5
  • WordPress version: 5.9.2
  • First release: Aug 12, 2020
  • Latest release: Oct 17, 2020
  • Number of updates: 5
  • Update frequency: every 30.0 days
  • Top authors: romainguillaume (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 351 total downloads

Benchmarks

Plugin footprint Passed 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: ▼1.06MB] [CPU: ▼328.65ms] Passed 4 tests

Server-side resources used by Places
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▼0.0049.68 ▼1.30
Dashboard /wp-admin3.24 ▼0.1719.67 ▼11.88
Posts /wp-admin/edit.php3.30 ▼0.3321.73 ▼14.10
Add New Post /wp-admin/post-new.php3.28 ▼3.6928.52 ▼1,283.56
Media Library /wp-admin/upload.php3.26 ▼0.0317.79 ▼5.05
Add New /wp-admin/post-new.php?post_type=places3.2726.76
Places /wp-admin/edit.php?post_type=places3.2920.41

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Places
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,956 ▲20217.53 ▲1.8311.72 ▲6.052.06 ▼0.65
Dashboard /wp-admin2,939 ▲857.29 ▲1.10117.65 ▼31.67155.29 ▼12.40
Posts /wp-admin/edit.php2,743 ▲863.49 ▲0.2566.86 ▲2.36142.74 ▲3.41
Add New Post /wp-admin/post-new.php1,716 ▲4819.56 ▲2.97450.69 ▲70.86153.31 ▼2.39
Media Library /wp-admin/upload.php1,747 ▲496.24 ▲0.69124.90 ▼16.73184.96 ▲1.28
Add New /wp-admin/post-new.php?post_type=places9,29519.57581.33182.15
Places /wp-admin/edit.php?post_type=places1,4603.3961.92112.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any 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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=places
    • > Notice in wp-content/plugins/places/inc/CF-places.php+117
    Undefined index: place_updates_address
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=places
    • > Notice in wp-content/plugins/places/inc/CF-geocoding-places.php+12
    Undefined variable: index_js
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=places
    • > User notice in wp-includes/functions.php+5768
    WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 50% 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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/places/places.php:23

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Places post type), #2 (Places block), #3 (Front end display)
You can look at the official readme.txt

places/places.php 92% from 13 tests

"Places" version 0.1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and 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

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
Everything looks great! No dangerous files found in this plugin17,476 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript65,2086,94816,191
CSS35662585
PHP55391333
JSX2320286
PO File1232780
JSON1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.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
5 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/leaflet/images/layers-2x.png1.23KB1.67KB0.00%
inc/leaflet/images/marker-shadow.png0.60KB1.16KB0.00%
inc/leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%
inc/leaflet/images/layers.png0.68KB1.05KB0.00%
inc/leaflet/images/marker-icon.png1.43KB1.55KB0.00%