10% wp-cloudmade-maps

Code Review | WP Cloudmade Maps

WordPress plugin WP Cloudmade Maps scored10%from 54 tests.

About plugin

  • Plugin page: wp-cloudmade-maps
  • Plugin version: 0.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.4.2
  • WordPress version: 6.3.1
  • First release: Dec 23, 2011
  • Latest release: Sep 23, 2012
  • Number of updates: 14
  • Update frequency: every 21.4 days
  • Top authors: carstenbach (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,107 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/wp-cloudmade-maps/cloudmade-map.php+1926
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼48.69ms] Passed 4 tests

Server-side resources used by WP Cloudmade Maps
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.446.23 ▼35.84
Dashboard /wp-admin2.05 ▼1.268.01 ▼41.89
Posts /wp-admin/edit.php2.05 ▼1.319.48 ▼36.47
Add New Post /wp-admin/post-new.php2.05 ▼3.847.26 ▼80.55
Media Library /wp-admin/upload.php2.05 ▼1.188.73 ▼25.55
Credits /wp-admin/admin.php?page=wp-cloudmade-maps-credits2.057.12
General /wp-admin/admin.php?page=wp-cloudmade-maps-general-options2.058.73

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 62 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

WP Cloudmade Maps: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.24 ▼0.161.69 ▲0.0444.52 ▲4.23
Dashboard /wp-admin2,214 ▲375.56 ▼0.1190.62 ▼11.9584.77 ▲40.41
Posts /wp-admin/edit.php2,134 ▲291.98 ▼0.0434.46 ▼2.0534.09 ▲2.77
Add New Post /wp-admin/post-new.php1,573 ▲4523.00 ▼0.10731.50 ▲50.0251.82 ▼19.43
Media Library /wp-admin/upload.php1,425 ▲254.22 ▼0.00100.07 ▲3.2076.37 ▲33.75
Credits /wp-admin/admin.php?page=wp-cloudmade-maps-credits8452.0023.6225.81
General /wp-admin/admin.php?page=wp-cloudmade-maps-general-options1,0832.3329.2530.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-cloudmade-maps/cloudmade-map.php+118
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-cloudmade-maps-general-options
    • > Deprecated in wp-content/plugins/wp-cloudmade-maps/cloudmade-map.php+120
    Function create_function() is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-cloudmade-maps-general-options
    • > Warning in wp-content/plugins/wp-cloudmade-maps/cloudmade-map.php+128
    Creating default object from empty value
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-cloudmade-maps-general-options
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

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 fix the following items
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-cloudmade-maps/menu/credits.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wp-cloudmade-maps/menu/static.php:4
    • > PHP Notice
      Undefined variable: screen_id in wp-content/plugins/wp-cloudmade-maps/menu/contextual_help.php on line 10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-cloudmade-maps/tinymce/tiny_windowform.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wp-cloudmade-maps/menu/active.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-cloudmade-maps/widgets/last-posts-widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-cloudmade-maps/class.CloudMadeMap.settings.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-cloudmade-maps/cloudmade-map.php:28
    • > PHP Notice
      Undefined variable: screen_id in wp-content/plugins/wp-cloudmade-maps/menu/contextual_help.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wp-cloudmade-maps/menu/general.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=wp-cloudmade-maps-general-options
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-cloudmade-maps/js/cmm-admin.js?ver=0.0.8:52:44)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wp-cloudmade-maps-general-options
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (GUI for embedding the shortcodes user-friendly), #2 (General Settings Screen), #3 (Settings Screen for Static maps options), #4 (Settings Screen for Active maps options), #5 ("Choose Location" metabox on the Edit Screen), #6 (Map inserted in post as "user-friendly" shortcode)
The official readme.txt is a good inspiration

wp-cloudmade-maps/cloudmade-map.php 85% from 13 tests

"WP Cloudmade Maps" version 0.0.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-cloudmade-maps.php" instead of "cloudmade-map.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 146 characters long)

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
Good job! No executable or dangerous file extensions detected4,326 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP115495612,160
JavaScript103173151,019
CSS610494794
PO File1162293353

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity99.00
▷ Minimum class complexity8.00
▷ Maximum class complexity190.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods56
▷ Static methods610.71%
▷ Public methods5191.07%
▷ Protected methods00.00%
▷ Private methods58.93%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants225.00%
▷ Class constants675.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jQuery-slider/redmond/images/ui-icons_6da8d5_256x240.png4.28KB4.13KB▼ 3.54%
css/jQuery-slider/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png0.09KB0.09KB0.00%
css/jQuery-slider/redmond/images/ui-bg_flat_55_fbec88_40x100.png0.18KB0.08KB▼ 52.20%
img/marker_icon.png3.18KB0.43KB▼ 86.39%
css/jQuery-slider/redmond/images/ui-bg_glass_85_dfeffc_1x400.png0.12KB0.15KB0.00%