77% event-calendar-with-map-view

Code Review | Event Calendar With Map View(ECWMV)

WordPress plugin Event Calendar With Map View(ECWMV) scored 77% from 54 tests.

About plugin

  • Plugin page: event-calendar-wi...
  • Plugin version: 0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.4
  • WordPress version: 5.9.2
  • First release: Dec 22, 2015
  • Latest release: Feb 23, 2016
  • Number of updates: 14
  • Update frequency: every 4.6 days
  • Top authors: harshpandya (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 6,290 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.78MB] [CPU: ▼315.66ms] Passed 4 tests

This is a short check of server-side resources used by Event Calendar With Map View(ECWMV)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1555.95 ▲4.61
Dashboard /wp-admin3.57 ▲0.1634.95 ▲1.92
Posts /wp-admin/edit.php3.79 ▲0.1539.67 ▼1.68
Add New Post /wp-admin/post-new.php3.38 ▼3.5930.12 ▼1,265.37
Media Library /wp-admin/upload.php3.45 ▲0.1625.68 ▲2.51
Event Category /wp-admin/edit-tags.php?taxonomy=ecwmv-category&post_type=ecwmv-event3.4526.49
All Events /wp-admin/edit.php?post_type=ecwmv-event3.4926.10
Add New /wp-admin/post-new.php?post_type=ecwmv-event3.6437.31
Settings /wp-admin/edit.php?post_type=ecwmv-event&page=ecwmv-settings3.4622.70

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 39 new files
Database: no new tables, 9 new options
New WordPress options
ecwmv_default_settings
ecwmv_view_display
widget_ecwmv_widget
ecwmv_meta_fields
ecwmv_map_center_lng
ecwmv_curr_symbol
ecwmv_theme_style
ecwmv_map_center_lat
ecwmv_map_zoom

Browser metrics Passed 4 tests

An overview of browser requirements for Event Calendar With Map View(ECWMV)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,818 ▲9616.05 ▲0.0611.12 ▲5.612.16 ▼0.09
Dashboard /wp-admin2,939 ▲816.11 ▼0.04116.13 ▼22.87157.17 ▼7.55
Posts /wp-admin/edit.php2,733 ▲423.25 ▲0.0262.78 ▼1.78141.97 ▼2.70
Add New Post /wp-admin/post-new.php1,789 ▲12817.25 ▼0.27419.03 ▲15.51156.07 ▼1.14
Media Library /wp-admin/upload.php1,742 ▲415.46 ▼0.06142.84 ▲4.65189.54 ▲8.22
Event Category /wp-admin/edit-tags.php?taxonomy=ecwmv-category&post_type=ecwmv-event1,6642.7855.07109.42
All Events /wp-admin/edit.php?post_type=ecwmv-event1,4423.1658.42110.00
Add New /wp-admin/post-new.php?post_type=ecwmv-event4,64713.98274.75381.31
Settings /wp-admin/edit.php?post_type=ecwmv-event&page=ecwmv-settings1,2472.4153.20117.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • ecwmv_meta_fields
    • ecwmv_theme_style
    • ecwmv_map_center_lat
    • ecwmv_view_display
    • ecwmv_default_settings
    • ecwmv_map_center_lng
    • ecwmv_curr_symbol
    • ecwmv_map_zoom
    • widget_ecwmv_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=ecwmv-event
    • > Warning in wp-content/plugins/event-calendar-with-map-view/register_fields.php+19
    Use of undefined constant ecwmv_create_field - assumed 'ecwmv_create_field' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/post-new.php?post_type=ecwmv-event
    • > Notice in wp-content/plugins/event-calendar-with-map-view/js/location-map.php+3
    Undefined index: post
    • > GET request to /wp-admin/edit.php?post_type=ecwmv-event&page=ecwmv-settings
    • > Notice in wp-content/plugins/event-calendar-with-map-view/settings.php+6
    Undefined index: setting_nonce

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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/event-calendar-with-map-view/js/location-map.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/event-calendar-with-map-view/register_widget.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% 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
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Calendar View with on hover event details.), #2 (Single Page of Event with all details.), #3 (Edit Event Page on admin side.), #4 (Category add, edit and delete for events.), #5 (Event Setting page in admin side.), #6 (List View of events.), #7 (Grid View of events.), #8 (Map view with each events as marker and on click you can find info window of that event.), #9 (Event Listing Widget)
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
The official readme.txt is a good inspiration

event-calendar-with-map-view/index.php 92% from 13 tests

The main file in "Event Calendar With Map View(ECWMV)" v. 0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("event-calendar-with-map-view.php" instead of "index.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
There were no executable files found in this plugin15,105 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript63,0811,72510,228
CSS123492393,892
PHP813522985

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 1.41MB with 0.83MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png306.32KB118.79KB▼ 61.22%
screenshot-4.png50.70KB19.36KB▼ 61.82%
screenshot-8.png336.68KB141.43KB▼ 57.99%
screenshot-1.png57.41KB22.23KB▼ 61.28%
view/img/marker-icon-old.png10.36KB5.12KB▼ 50.60%