10% map-my-posts

Code Review | Map My Posts

WordPress plugin Map My Posts scored10%from 54 tests.

About plugin

  • Plugin page: map-my-posts
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.3
  • WordPress version: 6.3.1
  • First release: Jul 4, 2013
  • Latest release: Dec 7, 2019
  • Number of updates: 20
  • Update frequency: every 117.4 days
  • Top authors: epfantasia (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /13,552 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.80MB] [CPU: ▼52.60ms] Passed 4 tests

Server-side resources used by Map My Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.275.46 ▼36.50
Dashboard /wp-admin2.21 ▼1.096.08 ▼41.95
Posts /wp-admin/edit.php2.21 ▼1.156.42 ▼43.86
Add New Post /wp-admin/post-new.php2.21 ▼3.685.80 ▼88.10
Media Library /wp-admin/upload.php2.22 ▼1.006.34 ▼27.81
Map My Posts /wp-admin/options-general.php?page=map-my-posts2.226.01

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 14 new options
New WordPress options
mmp_post_tag_country_list
mmp_settings
widget_recent-posts
db_upgraded
widget_mapmypostswidgetgmap
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
mmp_category_marker_list
widget_mapmypostswidgetgeochart
...

Browser metrics Passed 4 tests

Map My Posts: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7613.23 ▼1.351.66 ▼0.1239.98 ▼2.46
Dashboard /wp-admin2,217 ▲295.85 ▲0.96103.98 ▼6.4941.24 ▼3.25
Posts /wp-admin/edit.php2,102 ▲102.01 ▲0.0439.51 ▲0.3237.50 ▼0.02
Add New Post /wp-admin/post-new.php1,543 ▲2923.39 ▲5.86589.68 ▼109.2250.40 ▼11.97
Media Library /wp-admin/upload.php1,399 ▲144.24 ▲0.03100.51 ▲1.5843.94 ▼0.06
Map My Posts /wp-admin/options-general.php?page=map-my-posts1,9635.33159.2239.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • The uninstall procedure has failed, leaving 14 options in the database
    • db_upgraded
    • widget_mapmypostswidgetgeochart
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • mmp_category_country_list
    • mmp_post_tag_marker_list
    • widget_recent-posts
    • widget_recent-comments
    • widget_mapmypostswidgetgmap
    • ...

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
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in MapMyPostsWidgetStatic is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in MapMyPostsWidgetGmap is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in MapMyPostsWidgetGeochart is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > Notice in wp-content/plugins/map-my-posts/inc/MapMyPostsAdmin.php+186
    Undefined index: maptype
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > Notice in wp-content/plugins/map-my-posts/views/admin-settings.php+33
    Undefined index: api_key
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=map-my-posts
    • > Notice in wp-content/plugins/map-my-posts/views/admin-settings.php+48
    Undefined index: region

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant MAPMYPOSTS_URL - assumed 'MAPMYPOSTS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/map-my-posts/views/admin-settings.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/map-my-posts/inc/MapMyPostsWidgetGeochart.php:12
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/map-my-posts/views/gmap.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/map-my-posts/views/widget-form-gmap.php:13
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/map-my-posts/views/geochart.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/map-my-posts/views/admin-settings.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/map-my-posts/inc/MapMyPostsWidgetGmap.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/map-my-posts/inc/MapMyPostsWidgetStatic.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/map-my-posts/views/edit-terms.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/map-my-posts/views/widget-form-static.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
Please take inspiration from this readme.txt

map-my-posts/start.php 92% from 13 tests

"Map My Posts" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("map-my-posts.php" instead of "start.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin2,850 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP141676241,815
PO File1358375815
JavaScript21715205
CSS22015

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity25.83
▷ Minimum class complexity4.00
▷ Maximum class complexity74.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods52
▷ Static methods1223.08%
▷ Public methods5096.15%
▷ Protected methods00.00%
▷ Private methods23.85%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/atw_globe_32x32.png3.26KB1.70KB▼ 47.81%