78% placepress

Code Review | PlacePress

WordPress plugin PlacePress scored 78% from 54 tests.

About plugin

  • Plugin page: placepress
  • Plugin version: 1.3.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.8.1
  • First release: Jun 1, 2019
  • Latest release: Jan 25, 2022
  • Number of updates: 23
  • Update frequency: every 42.2 days
  • Top authors: cphdh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,632 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▼151.27ms] Passed 4 tests

Server-side resources used by PlacePress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.14 ▲0.2925.34 ▲4.43
Dashboard /wp-admin3.43 ▲0.3632.76 ▼3.68
Posts /wp-admin/edit.php3.49 ▲0.3833.12 ▲2.39
Add New Post /wp-admin/post-new.php5.84 ▲0.4052.46 ▼605.48
Media Library /wp-admin/upload.php3.31 ▲0.3025.89 ▲1.71
Add New /wp-admin/post-new.php?post_type=locations5.8446.35
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tours3.3124.09
Add New /wp-admin/post-new.php?post_type=tours5.8445.79
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=locations3.3123.68
All Tours /wp-admin/edit.php?post_type=tours3.3726.64
PlacePress /wp-admin/options-general.php?page=placepress3.2921.08
Location Types /wp-admin/edit-tags.php?taxonomy=location_types&post_type=locations3.3124.22
Tour Types /wp-admin/edit-tags.php?taxonomy=tour_types&post_type=tours3.3123.87
All Locations /wp-admin/edit.php?post_type=locations3.3729.31

Server storage [IO: ▲1.09MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 58 new files
Database: no new tables, 17 new options
New WordPress options
default_longitude
default_latitude
mapbox_key
maki_markers
maki_markers_color
tours_caption_display
tours_floating_map_display
widget_placepress_widget
default_map_type
enable_locations
...

Browser metrics Passed 4 tests

PlacePress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲18416.04 ▼0.014.92 ▼0.4175.60 ▲0.31
Dashboard /wp-admin3,039 ▲1406.06 ▼0.06121.63 ▼8.40174.60 ▲6.54
Posts /wp-admin/edit.php2,836 ▲963.24 ▲0.0164.99 ▲2.44150.67 ▲18.86
Add New Post /wp-admin/post-new.php3,896 ▲15519.28 ▲0.45442.09 ▲7.71172.45 ▼7.94
Media Library /wp-admin/upload.php1,847 ▲1015.52 ▼0.02140.89 ▼18.63180.35 ▼1.70
Add New /wp-admin/post-new.php?post_type=locations5,82821.54459.79171.24
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tours1,9432.7856.14126.67
Add New /wp-admin/post-new.php?post_type=tours5,83616.08369.69172.80
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=locations1,9372.7759.73123.94
All Tours /wp-admin/edit.php?post_type=tours1,5543.4580.53110.87
PlacePress /wp-admin/options-general.php?page=placepress1,7633.4287.80187.90
Location Types /wp-admin/edit-tags.php?taxonomy=location_types&post_type=locations1,8502.7758.12124.51
Tour Types /wp-admin/edit-tags.php?taxonomy=tour_types&post_type=tours1,8562.7855.98122.37
All Locations /wp-admin/edit.php?post_type=locations1,5543.4575.73112.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 17 options
    • mapbox_satellite
    • default_longitude
    • maki_markers
    • default_zoom
    • enable_location_archive_map
    • marker_clustering
    • enable_tours
    • tours_floating_map_display
    • default_map_type
    • enable_locations
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tours
    • > User deprecated in wp-includes/functions.php+5586
    block_categories is deprecated since version 5.8.0! Use block_categories_all instead.

SRP Passed 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 SRP test was a success

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tours
    • > Console-api (warning) in wp-includes/js/dist/blocks.min.js?ver=7ed7fe32dad771c4e0af4f56539ff156+1:40463
    Block validation: Expected attribute `%s` of value `%s`, saw `%s`." "style" "height:100px" "height:5px
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tours
    • > Console-api (severe) in wp-includes/js/dist/blocks.min.js?ver=7ed7fe32dad771c4e0af4f56539ff156+1:40463
    Block validation: Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s" "core/spacer" Object "\u003Cdiv style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\">\u003C/div>" "\u003Cdiv style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\">\u003C/div>

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can look at the official readme.txt

placepress/placepress.php 85% from 13 tests

This is the main PHP file of "PlacePress" version 1.3.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 154 characters long)
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin20,691 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
JSON20015,773
JavaScript121961332,868
PHP161662421,246
Sass9626726
CSS30061
Markdown18017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png21.36KB6.76KB▼ 68.35%
assets/icon-256x256.png53.07KB15.38KB▼ 71.03%