10% events-and-docs

Code Review | EventsnDocs

WordPress plugin EventsnDocs scored10%from 54 tests.

About plugin

  • Plugin page: events-and-docs
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Sep 2, 2016
  • Latest release: Sep 14, 2016
  • Number of updates: 8
  • Update frequency: every 3.5 days
  • Top authors: ernestortiz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /675 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
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/events-and-docs/eventsndocs.php+100
    Undefined variable: eventsndocs

Server metrics [RAM: ▼1.92MB] [CPU: ▼52.83ms] Passed 4 tests

Analyzing server-side resources used by EventsnDocs
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.79 ▼30.03
Dashboard /wp-admin2.10 ▼1.246.20 ▼53.45
Posts /wp-admin/edit.php2.10 ▼1.256.33 ▼38.88
Add New Post /wp-admin/post-new.php2.10 ▼3.786.11 ▼88.94
Media Library /wp-admin/upload.php2.10 ▼1.136.31 ▼25.96
Add New /wp-admin/post-new.php?post_type=eventsndocs2.106.26
All Events /wp-admin/edit.php?post_type=eventsndocs2.107.02
Event Categories /wp-admin/edit-tags.php?taxonomy=eventsndocs_cat&post_type=eventsndocs2.105.60
Events and Docs /wp-admin/options-general.php?page=eventsndocs2.106.86

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for EventsnDocs
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9814.77 ▲0.391.73 ▼0.1142.02 ▼1.89
Dashboard /wp-admin2,245 ▲545.07 ▲0.17111.51 ▲11.0041.57 ▼2.32
Posts /wp-admin/edit.php2,128 ▲392.03 ▼0.1434.59 ▼2.4935.09 ▲0.44
Add New Post /wp-admin/post-new.php6,243 ▲4,70726.28 ▲3.15938.57 ▲301.0377.03 ▲24.51
Media Library /wp-admin/upload.php1,427 ▲424.19 ▼0.03107.11 ▲11.3146.95 ▲3.27
Add New /wp-admin/post-new.php?post_type=eventsndocs2,4778.05190.7674.46
All Events /wp-admin/edit.php?post_type=eventsndocs1,1642.2536.0429.67
Event Categories /wp-admin/edit-tags.php?taxonomy=eventsndocs_cat&post_type=eventsndocs1,2982.1527.1525.91
Events and Docs /wp-admin/options-general.php?page=eventsndocs9161.6925.3531.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/events-and-docs/eventsndocs.php+100
    Undefined variable: eventsndocs
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=eventsndocs
    • > Notice in wp-content/plugins/events-and-docs/eventsndocs.php+100
    Undefined variable: eventsndocs
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=eventsndocs
    • > Notice in wp-content/plugins/events-and-docs/eventsndocs.php+87
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=eventsndocs
    • > Notice in wp-content/plugins/events-and-docs/eventsndocs.php+65
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/options-general.php?page=eventsndocs
    • > Notice in wp-content/plugins/events-and-docs/optionspage.php+109
    Undefined index: on_uninstall

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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/events-and-docs/optionspage.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/events-and-docs/eventsndocs.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/events-and-docs/metaboxes.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/events-and-docs/dashboard.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/events-and-docs/shortcodes.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=eventsndocs
    • > Network (severe)
    http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 403 (Forbidden)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=eventsndocs
    • > Network (severe)
    http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 403 (Forbidden)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=eventsndocs
    • > Javascript (severe) in unknown
    https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js?ver=6.3.1 0:0 Uncaught ReferenceError: L is not defined
    • > GET request to /wp-admin/post-new.php?post_type=eventsndocs
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: L is not defined" "ReferenceError: L is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/events-and-docs/js/map_backend.js?ver=6.3.1:8:23)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&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,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=eventsndocs
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught ReferenceError: L is not defined
    • > GET request to /wp-admin/edit.php?post_type=eventsndocs
    • > 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: L is not defined" "ReferenceError: L is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/events-and-docs/js/map_backend.js?ver=6.3.1:8:23)\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/edit.php?post_type=eventsndocs
    • > 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 ReferenceError: L is not defined

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

events-and-docs/eventsndocs.php 69% from 13 tests

The main PHP script in "EventsnDocs" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("events-and-docs.php" instead of "eventsndocs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,084 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP6501851,021
CSS33544773
PO File17576191
JavaScript3142399

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%