82% placemarks

Code Review | Placemarks

WordPress plugin Placemarks scored 82% from 54 tests.

About plugin

  • Plugin page: placemarks
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.2
  • WordPress version: 5.8.1
  • First release: Oct 24, 2013
  • Latest release: Oct 13, 2019
  • Number of updates: 43
  • Update frequency: every 51.2 days
  • Top authors: gabrielmcgovern (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 2,541 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.11MB] [CPU: ▼159.19ms] Passed 4 tests

Analyzing server-side resources used by Placemarks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.11 ▲0.3943.72 ▲22.07
Dashboard /wp-admin3.41 ▲0.3644.78 ▼3.07
Posts /wp-admin/edit.php3.46 ▲0.3548.72 ▲3.88
Add New Post /wp-admin/post-new.php3.99 ▼1.4530.64 ▼637.39
Media Library /wp-admin/upload.php3.29 ▲0.2935.98 ▼0.17
Placemarks /wp-admin/options-general.php?page=placemarks3.2631.29

Server storage [IO: ▲2.72MB] [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: 53 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Placemarks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,747 ▲15115.93 ▲0.258.78 ▼0.6543.67 ▼0.94
Dashboard /wp-admin3,007 ▲785.91 ▲0.00138.54 ▼12.54112.97 ▲0.21
Posts /wp-admin/edit.php2,779 ▲402.70 ▼0.0165.85 ▼5.2885.43 ▲3.59
Add New Post /wp-admin/post-new.php1,702 ▲3018.81 ▼0.14400.57 ▼11.43109.10 ▲2.33
Media Library /wp-admin/upload.php1,847 ▲375.02 ▲0.01153.85 ▼0.58114.96 ▲9.02
Placemarks /wp-admin/options-general.php?page=placemarks1,1012.0856.8979.36
Placemarks /wp-admin/settings.php?page=placemarks260.900.0510.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 25% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/placemarks/public/partials/placemarks-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/placemarks/includes/class-placemarks-api.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/settings.php?page=placemarks
    • > Network (severe)
    wp-admin/settings.php?page=placemarks - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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
Please fix the following attributes:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === placemarks === )
  • Screenshots: Add descriptions for screenshots #2, #3, #4, #5 in placemarks/assets to your readme.txt
You can take inspiration from this readme.txt

placemarks/placemarks.php Passed 13 tests

The main PHP script in "Placemarks" version 3.0.1 is automatically included on every request by WordPress
71 characters long description:
Easily manage placemarks and embed custom maps (now with OpenStreetMap)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin18,389 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript125,3137,08716,495
PHP15277810995
CSS37742893
XML6006

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.36
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods58
▷ Static methods23.45%
▷ Public methods4475.86%
▷ Protected methods11.72%
▷ Private methods1322.41%
Functions8
▷ Named functions337.50%
▷ Anonymous functions562.50%
Constants1
▷ Global constants1100.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
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/leaflet/images/layers.png0.68KB1.05KB0.00%
vendor/leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%
vendor/leaflet/images/marker-icon.png1.43KB1.55KB0.00%
vendor/leaflet/images/layers-2x.png1.23KB1.67KB0.00%
public/images/default.png1.11KB1.11KB0.00%