73% simple-mapbox-data

Code Review | Simple Mapbox Data

WordPress plugin Simple Mapbox Data scored73%from 54 tests.

About plugin

  • Plugin page: simple-mapbox-data
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.2
  • WordPress version: 6.3.1
  • First release: Feb 2, 2018
  • Latest release: Feb 3, 2018
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: raquelmsmith (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /590 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.15MB] [CPU: ▼10.32ms] Passed 4 tests

This is a short check of server-side resources used by Simple Mapbox Data
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1536.73 ▼2.73
Dashboard /wp-admin3.45 ▲0.1045.88 ▼13.22
Posts /wp-admin/edit.php3.56 ▲0.2049.86 ▲2.61
Add New Post /wp-admin/post-new.php6.15 ▲0.2785.21 ▼27.92
Media Library /wp-admin/upload.php3.37 ▲0.1439.13 ▲7.58
All Map Data Points /wp-admin/edit.php?post_type=map_data_point3.4238.19
Add New /wp-admin/post-new.php?post_type=map_data_point5.7170.31
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=map_data_point3.3635.15
Simple Mapbox Data /wp-admin/options-general.php?page=simple-mapbox-data3.3831.09
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=map_data_point3.3637.90

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
category_children
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Simple Mapbox Data
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲18313.97 ▼0.545.23 ▲3.4237.86 ▼4.70
Dashboard /wp-admin2,246 ▲584.89 ▲0.01101.48 ▼3.2138.12 ▼2.22
Posts /wp-admin/edit.php2,132 ▲432.04 ▲0.0540.96 ▼1.0735.21 ▼0.91
Add New Post /wp-admin/post-new.php1,559 ▲4018.34 ▼4.85640.33 ▲41.2850.76 ▼1.54
Media Library /wp-admin/upload.php1,425 ▲434.23 ▲0.0796.55 ▲0.2641.07 ▼0.84
All Map Data Points /wp-admin/edit.php?post_type=map_data_point1,1591.9434.3230.37
Add New /wp-admin/post-new.php?post_type=map_data_point6,30022.94903.7539.45
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=map_data_point1,3502.1526.4330.48
Simple Mapbox Data /wp-admin/options-general.php?page=simple-mapbox-data1,1731.7124.6828.30
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=map_data_point1,4892.1628.4030.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • category_children

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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=map_data_point
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/class-simple-mapbox-data-admin.php+184
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/post-new.php?post_type=map_data_point
    • > Warning in wp-content/plugins/simple-mapbox-data/admin/class-simple-mapbox-data-admin.php+186
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+47
    Undefined variable: mapbox_account_username
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+55
    Undefined variable: mapbox_access_token
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+63
    Undefined variable: mapbox_dataset_id
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+71
    Undefined variable: mapbox_tileset_id
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+93
    Undefined variable: smd_custom_field_0
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+99
    Undefined variable: smd_custom_field_0_type
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+93
    Undefined variable: smd_custom_field_1
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+99
    Undefined variable: smd_custom_field_1_type
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+93
    Undefined variable: smd_custom_field_2
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=simple-mapbox-data
    • > Notice in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php+99
    Undefined variable: smd_custom_field_2_type

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-mapbox-data/public/partials/simple-mapbox-data-public-display.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-options-display.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/simple-mapbox-data/tests/test-sample.php:11
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/simple-mapbox-data/tests/bootstrap.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-mapbox-data/tests/bootstrap.php on line 14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/simple-mapbox-data/admin/partials/simple-mapbox-data-admin-display.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid url: "raquelmsmith.com"
Please take inspiration from this readme.txt

simple-mapbox-data/simple-mapbox-data.php Passed 13 tests

The main PHP file in "Simple Mapbox Data" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
70 characters long description:
Manage your Mapbox data from right within your WordPress installation.

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
There were no executable files found in this plugin975 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP15188585731
Bourne Shell121799
JavaScript27078
CSS212842
XML24225

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.12
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.38MB with 0.27MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/simple-mapbox-data-settings-page.png304.63KB87.10KB▼ 71.41%
assets/simple-mapbox-data-meta-box.png80.58KB20.68KB▼ 74.33%