10% posts-on-a-map

Code Review | Posts on a map

WordPress plugin Posts on a map scored10%from 54 tests.

About plugin

  • Plugin page: posts-on-a-map
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.4
  • WordPress version: 6.3.1
  • First release: Nov 11, 2012
  • Latest release: Nov 15, 2012
  • Number of updates: 9
  • Update frequency: every 0.4 days
  • Top authors: jeancaffou (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,305 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/posts-on-a-map/class.point.php+13
    Methods with the same name as their class will not be constructors in a future version of PHP; point has a deprecated constructor

Server metrics [RAM: ▼1.87MB] [CPU: ▼54.11ms] Passed 4 tests

A check of server-side resources used by Posts on a map
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.355.82 ▼35.55
Dashboard /wp-admin2.14 ▼1.177.50 ▼44.49
Posts /wp-admin/edit.php2.14 ▼1.228.11 ▼44.59
Add New Post /wp-admin/post-new.php2.14 ▼3.755.52 ▼91.82
Media Library /wp-admin/upload.php2.14 ▼1.097.30 ▼27.23
Posts on a map settings /wp-admin/options-general.php?page=jc_posts_map_settings2.146.68

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Posts on a map
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7814.13 ▼0.2524.10 ▲21.9540.79 ▼9.72
Dashboard /wp-admin2,210 ▲304.89 ▼0.06110.67 ▼39.9543.60 ▼15.34
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0135.31 ▼6.2830.53 ▼4.39
Add New Post /wp-admin/post-new.php1,522 ▼1120.54 ▼2.71660.98 ▲39.5653.23 ▲0.71
Media Library /wp-admin/upload.php1,395 ▲134.12 ▼0.0998.96 ▼3.3640.79 ▼1.25
Posts on a map settings /wp-admin/options-general.php?page=jc_posts_map_settings8302.0124.4826.16

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
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/posts-on-a-map/class.point.php+13
    Methods with the same name as their class will not be constructors in a future version of PHP; point has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=jc_posts_map_settings
    • > Deprecated in wp-content/plugins/posts-on-a-map/class.point.php+13
    Methods with the same name as their class will not be constructors in a future version of PHP; point has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=jc_posts_map_settings
    • > Deprecated in wp-content/plugins/posts-on-a-map/class.map.php+13
    Methods with the same name as their class will not be constructors in a future version of PHP; map has a deprecated constructor

SRP 50% 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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/posts-on-a-map/map.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Field in the Wordpress admin), #2 (How it looks on the page)
The official readme.txt is a good inspiration

posts-on-a-map/map.php 85% from 13 tests

"Posts on a map" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("posts-on-a-map.php" instead of "map.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin495 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP39171495

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity21.50
▷ Minimum class complexity19.00
▷ Maximum class complexity24.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.51MB with 0.34MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png15.05KB6.19KB▼ 58.86%
point.png3.68KB0.77KB▼ 79.11%
screenshot-2.png500.97KB190.02KB▼ 62.07%