10% travelers-map

Code Review | Travelers' Map

WordPress plugin Travelers' Map scored10%from 54 tests.

About plugin

  • Plugin page: travelers-map
  • Plugin version: 2.2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 4, 2019
  • Latest release: Jun 24, 2023
  • Number of updates: 41
  • Update frequency: every 36.2 days
  • Top authors: socrapop (100%)

Code review

54 tests

User reviews

38 reviews

Install metrics

1,000+ active /21,618 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/travelers-map/includes/admin/cttm-admin.php+374
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.36MB] [CPU: ▼5.12ms] Passed 4 tests

Analyzing server-side resources used by Travelers' Map
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3543.02 ▲0.44
Dashboard /wp-admin3.64 ▲0.3449.53 ▼5.73
Posts /wp-admin/edit.php3.76 ▲0.4047.81 ▼5.71
Add New Post /wp-admin/post-new.php6.29 ▲0.4095.52 ▼9.48
Media Library /wp-admin/upload.php3.57 ▲0.3449.28 ▲12.12
Customize markers /wp-admin/edit.php?post_type=cttm-marker3.7059.46
Shortcode Helper /wp-admin/admin.php?page=cttm_travelersmap_shortcode3.5744.33
Settings /wp-admin/admin.php?page=cttm_travelersmap3.5743.03

Server storage [IO: ▲3.41MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 466 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
cttm_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
travelersmap_version
db_upgraded

Browser metrics Passed 4 tests

Travelers' Map: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲9414.39 ▲0.201.73 ▼0.2543.64 ▼1.30
Dashboard /wp-admin2,261 ▲845.72 ▲0.0392.02 ▲2.0843.62 ▲0.54
Posts /wp-admin/edit.php2,163 ▲632.19 ▲0.1837.19 ▼2.7635.52 ▼1.13
Add New Post /wp-admin/post-new.php6,713 ▲5,18720.83 ▲3.311,074.08 ▲367.1666.87 ▲9.27
Media Library /wp-admin/upload.php1,655 ▲2554.67 ▲0.40121.68 ▲16.3448.58 ▲2.88
Customize markers /wp-admin/edit.php?post_type=cttm-marker2,1402.1735.5934.34
Shortcode Helper /wp-admin/admin.php?page=cttm_travelersmap_shortcode1,5544.0254.3844.38
Settings /wp-admin/admin.php?page=cttm_travelersmap1,3333.7146.0340.94

Uninstaller [IO: ▲0.01MB] [DB: ▲0.01MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • travelersmap_version

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 170× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Filter' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/Filter/ExtractStyleBlocks.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrTransform' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/AttrTransform/Textarea.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Lexer' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/Lexer/DOMLex.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Node' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/Node/Comment.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Node' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/Node/Text.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrTransform' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/AttrTransform/ScriptRequired.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Injector' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/Injector/PurifierLinkify.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_URIScheme' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/URIScheme/data.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_AttrDef_HTML_Pixels' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Length.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Injector' not found in wp-content/plugins/travelers-map/includes/admin/HTMLPurifier/HTMLPurifier/Injector/RemoveEmpty.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: openstreetmap, travelers, travel blog, leaftlet, geolocalize...

travelers-map/travelers-map.php Passed 13 tests

Analyzing the main PHP file in "Travelers' Map" version 2.2.0
55 characters long description:
Pin your Wordpress posts on a dynamic OpenStreetMap map

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected28,623 lines of code in 280 files:
LanguageFilesBlank linesComment linesLines of code
PHP2543,46510,47318,712
CSS8349655,682
JavaScript124345532,483
PO File34204671,481
LESS1735256
XML1108
INI1111

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 232)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity13.30
▷ Minimum class complexity1.00
▷ Maximum class complexity539.00
Average method complexity5.01
▷ Minimum method complexity1.00
▷ Maximum method complexity232.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes237
▷ Abstract classes156.33%
▷ Concrete classes22293.67%
▷ Final classes00.00%
Methods744
▷ Static methods456.05%
▷ Public methods57777.55%
▷ Protected methods8511.42%
▷ Private methods8211.02%
Functions62
▷ Named functions6198.39%
▷ Anonymous functions11.61%
Constants64
▷ Global constants69.38%
▷ Class constants5890.62%
▷ Public constants58100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
37 PNG files occupy 0.91MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cttm_markers-violet.png2.19KB1.73KB▼ 21.09%
includes/admin/images/excerpt.png7.58KB4.25KB▼ 43.93%
includes/admin/images/titlethumbdate.png120.58KB40.26KB▼ 66.61%
images/cttm_markers-orange.png1.99KB1.78KB▼ 10.70%
includes/public/images/search-icon.png3.75KB1.56KB▼ 58.42%