68% posts-maps

Code Review | Posts Maps

WordPress plugin Posts Maps scored 68% from 54 tests.

About plugin

  • Plugin page: posts-maps
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.2.4
  • WordPress version: 5.8.1
  • First release: Aug 8, 2015
  • Latest release: Aug 10, 2015
  • Number of updates: 14
  • Update frequency: every 0.1 days
  • Top authors: dmitrik86 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 762 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.81MB] [CPU: ▼190.96ms] Passed 4 tests

This is a short check of server-side resources used by Posts Maps
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.82 ▼1.019.00 ▼27.35
Dashboard /wp-admin1.84 ▼1.215.53 ▼43.42
Posts /wp-admin/edit.php1.84 ▼1.269.17 ▼38.06
Add New Post /wp-admin/post-new.php1.84 ▼3.595.01 ▼655.00
Media Library /wp-admin/upload.php1.84 ▼1.168.59 ▼26.93
Markers /wp-admin/admin.php?page=posts-maps-marker-icons1.847.61
Posts Maps /wp-admin/admin.php?page=posts-maps1.846.60

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 1 new option
New WordPress options
pm_marker_icons

Browser metrics Passed 4 tests

Checking browser requirements for Posts Maps
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,844 ▲24817.50 ▲2.0217.12 ▲9.4350.12 ▲1.02
Dashboard /wp-admin2,999 ▲657.12 ▲1.14148.28 ▼11.01162.64 ▲46.88
Posts /wp-admin/edit.php2,799 ▲602.87 ▲0.1872.92 ▲5.10130.65 ▲41.43
Add New Post /wp-admin/post-new.php1,611 ▲2015.43 ▼3.16422.46 ▲19.09137.12 ▲20.46
Media Library /wp-admin/upload.php1,793 ▼325.70 ▲0.70150.46 ▲2.88143.90 ▲16.50
Markers /wp-admin/admin.php?page=posts-maps-marker-icons1,3383.0664.32106.92
Posts Maps /wp-admin/admin.php?page=posts-maps1,1752.9360.0484.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the posts-maps handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 1 option in the database
    • pm_marker_icons

Smoke tests 50% 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)
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=posts-maps
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the posts-maps handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=posts-maps
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the maps-googleapis handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=posts-maps
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the pm-js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=posts-maps
    • > Notice in wp-content/plugins/posts-maps/PostsMaps/core/Plugin.php+139
    Undefined property: PostsMapsCorePlugin::$PostsMapsController

SRP 50% 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
Please take a closer look at the following
  • 6× 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/posts-maps/PostsMaps/views/marker.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PostsMapsCorePlugin' not found in wp-content/plugins/posts-maps/PostsMaps/controllers/PostsMapsController.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/posts-maps/PostsMaps/views/adminFieldsBox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/posts-maps/PostsMaps/views/main.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/posts-maps/PostsMaps/core/Plugin.php:55
    • > PHP Fatal error
      Uncaught Error: Class 'CorePlugin' not found in wp-content/plugins/posts-maps/PostsMaps/core/Plugin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

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
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === posts-maps === )
The official readme.txt is a good inspiration

posts-maps/posts-maps.php Passed 13 tests

This is the main PHP file of "Posts Maps" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
10 characters long description:
Posts maps

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
Success! There were no dangerous files found in this plugin903 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP146510647
JavaScript1190218
CSS11038

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity9.83
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods3480.95%
▷ Protected methods24.76%
▷ Private methods614.29%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
19 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/nat.png1.92KB0.89KB▼ 53.74%
assets/images/bea.png2.27KB1.63KB▼ 28.20%
assets/images/pyr.png1.96KB1.47KB▼ 24.99%
assets/images/cit.png1.63KB0.75KB▼ 54.34%
assets/images/squ.png2.23KB1.79KB▼ 19.80%