73% cpt-to-map-store

Code Review | Custom Post Type to Map Store

WordPress plugin Custom Post Type to Map Store scored73%from 54 tests.

About plugin

  • Plugin page: cpt-to-map-store
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: May 20, 2020
  • Latest release: Jun 19, 2020
  • Number of updates: 27
  • Update frequency: every 1.1 days
  • Top authors: lriaudel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,117 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.60MB] [CPU: ▼14.33ms] Passed 4 tests

An overview of server-side resources used by Custom Post Type to Map Store
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0743.97 ▲3.50
Dashboard /wp-admin3.39 ▲0.0545.03 ▼11.58
Posts /wp-admin/edit.php3.51 ▲0.1545.33 ▲0.30
Add New Post /wp-admin/post-new.php3.27 ▼2.6241.43 ▼49.55
Media Library /wp-admin/upload.php3.32 ▲0.0938.00 ▲3.82
CPT to Map Store /wp-admin/options-general.php?page=cpt-to-map-store3.3430.66

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Custom Post Type to Map Store
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.72 ▲0.321.52 ▲0.0641.41 ▼5.11
Dashboard /wp-admin2,199 ▲185.58 ▼0.1281.95 ▼21.7938.10 ▼1.03
Posts /wp-admin/edit.php2,104 ▲71.99 ▼0.0534.59 ▼1.3532.46 ▼5.71
Add New Post /wp-admin/post-new.php1,529 ▲123.53 ▲0.19666.24 ▲14.2245.86 ▼8.01
Media Library /wp-admin/upload.php1,407 ▲44.20 ▲0.0495.32 ▼3.0942.44 ▼0.00
CPT to Map Store /wp-admin/options-general.php?page=cpt-to-map-store1,2412.1221.9835.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cpt-to-map-store
    • > Notice in wp-content/plugins/cpt-to-map-store/admin/partials/cpt-to-map-store-admin-settings.php+184
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cpt-to-map-store/public/partials/cpt-to-map-store-public-display.php
    • > /wp-content/plugins/cpt-to-map-store/admin/partials/cpt-to-map-store-admin-settings.php
    • > /wp-content/plugins/cpt-to-map-store/admin/partials/cpt-to-map-store-admin-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cpt-to-map-store/admin/partials/cpt-to-map-store-presentation-card.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cpt-to-map-store/admin/partials/cpt-to-map-store-admin-settings.php:8

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 errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can take inspiration from this readme.txt

cpt-to-map-store/cpt-to-map-store.php Passed 13 tests

The entry point to "Custom Post Type to Map Store" version 1.1.0 is a PHP file that has certain tags in its header comment area
90 characters long description:
An another Store Locator on WordPress but with OpenStreetMap & Leaflet and Meta Fields

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin17,536 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript55,2226,91116,049
PHP11272520663
CSS45728638
PO File153104146
Markdown118040

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity16.00
▷ Minimum class complexity4.00
▷ Maximum class complexity26.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods13.03%
▷ Public methods1957.58%
▷ Protected methods26.06%
▷ Private methods1236.36%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants3
▷ Global constants3100.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
5 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lib/leaflet/images/marker-icon.png1.43KB1.55KB0.00%
assets/lib/leaflet/images/layers-2x.png1.23KB1.67KB0.00%
assets/lib/leaflet/images/marker-shadow.png0.60KB1.16KB0.00%
assets/lib/leaflet/images/layers.png0.68KB1.05KB0.00%
assets/lib/leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%