77% witty-map

Code Review | Witty Map

WordPress plugin Witty Map scored77%from 54 tests.

About plugin

  • Plugin page: witty-map
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 23, 2017
  • Latest release: Aug 29, 2017
  • Number of updates: 24
  • Update frequency: every 4.2 days
  • Top authors: robertreborobert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /814 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.75ms] Passed 4 tests

An overview of server-side resources used by Witty Map
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.22 ▲2.30
Dashboard /wp-admin3.39 ▲0.0446.30 ▼13.78
Posts /wp-admin/edit.php3.50 ▲0.1547.68 ▼2.70
Add New Post /wp-admin/post-new.php5.97 ▲0.0892.48 ▼5.92
Media Library /wp-admin/upload.php3.29 ▲0.0634.42 ▼0.58

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 13 new options
New WordPress options
wittymap_labelX
wittymap_labelY
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
wittymap_doubleClickZoom
can_compress_scripts
widget_recent-posts
wittymap_zoomControl
...

Browser metrics Passed 4 tests

An overview of browser requirements for Witty Map
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,984 ▲23814.94 ▲0.571.77 ▲0.1538.73 ▲0.89
Dashboard /wp-admin2,390 ▲2086.64 ▲1.77133.81 ▲7.3141.05 ▼5.01
Posts /wp-admin/edit.php2,295 ▲2063.67 ▲1.6254.69 ▲15.8732.89 ▼1.54
Add New Post /wp-admin/post-new.php1,712 ▲19222.75 ▼0.29577.71 ▼102.3336.10 ▼23.18
Media Library /wp-admin/upload.php1,435 ▲444.26 ▲0.0682.72 ▼16.0742.92 ▲0.04

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 13 options in the database
    • wittymap_zoomControl
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • wittymap_labelY
    • wittymap_doubleClickZoom
    • wittymap_labelX
    • wittymap_draggable
    • can_compress_scripts
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/witty-map/inc/partials/witty-field-imgbox.php
    • > /wp-content/plugins/witty-map/inc/partials/witty-field-common.php
    • > /wp-content/plugins/witty-map/inc/partials/witty-field-checkbox.php
    • > /wp-content/plugins/witty-map/admin/partials/witty-map-notice-err.php
    • > /wp-content/plugins/witty-map/public/partials/witty-map-wrap.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/witty-map/inc/partials/witty-field-checkbox.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'witty_support' not found in wp-content/plugins/witty-map/admin/partials/witty-map-option-page.php:8
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/witty-map/inc/partials/witty-field-checkbox.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/witty-map/public/class-wittymap-public.php:73
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/witty-map/inc/partials/witty-field-common.php on line 10
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/witty-map/inc/partials/witty-field-checkbox.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/witty-map/admin/class-wittymap-backend.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'witty_support' not found in wp-content/plugins/witty-map/admin/partials/witty-map-option-fields.php:8
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/witty-map/inc/partials/witty-field-imgbox.php on line 14
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/witty-map/inc/partials/witty-field-common.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% 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:
  • Requires at least: The plugin version is formatted incorrectly
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

witty-map/witty-map.php 77% from 13 tests

"Witty Map" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 156 characters long)
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin1,037 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP11107199477
JavaScript3107235465
CSS342295

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.00
▷ Minimum class complexity3.00
▷ Maximum class complexity6.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods2187.50%
▷ Protected methods00.00%
▷ Private methods312.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin