10% map-it-by-two-row-studio

Code Review | Map It! by Two Row Studio

WordPress plugin Map It! by Two Row Studio scored10%from 54 tests.

About plugin

  • Plugin page: map-it-by-two-row...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7.1
  • WordPress version: 6.3.1
  • First release: Oct 10, 2019
  • Latest release: Apr 15, 2021
  • Number of updates: 82
  • Update frequency: every 6.8 days
  • Top authors: tworowstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /700 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
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/map-it-by-two-row-studio/functions/init.php+52
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.95MB] [CPU: ▼55.86ms] Passed 4 tests

An overview of server-side resources used by Map It! by Two Row Studio
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.429.05 ▼31.22
Dashboard /wp-admin2.06 ▼1.287.31 ▼50.90
Posts /wp-admin/edit.php2.06 ▼1.297.92 ▼42.41
Add New Post /wp-admin/post-new.php2.06 ▼3.827.57 ▼98.89
Media Library /wp-admin/upload.php2.06 ▼1.167.60 ▼23.67

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 33 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
_trmi_db_version
widget_theysaidso_widget
_trmi_version
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Map It! by Two Row Studio
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲13214.92 ▲0.519.07 ▲7.2427.20 ▼12.69
Dashboard /wp-admin2,231 ▲435.71 ▲0.8498.73 ▼2.0741.87 ▲1.14
Posts /wp-admin/edit.php2,117 ▲282.49 ▲0.4745.73 ▲1.8136.99 ▲0.47
Add New Post /wp-admin/post-new.php1,536 ▲823.71 ▲5.57695.77 ▲75.8939.13 ▼13.89
Media Library /wp-admin/upload.php1,410 ▲195.08 ▲0.91100.95 ▼0.2942.49 ▼0.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/map-it-by-two-row-studio/functions/init.php+52
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 15× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/map-it-by-two-row-studio/trs_mapit.php
    • > /wp-content/plugins/map-it-by-two-row-studio/functions/init.php
    • > /wp-content/plugins/map-it-by-two-row-studio/functions/shortcodes/trmi_map.php
    • > /wp-content/plugins/map-it-by-two-row-studio/classes/google/class_info_window.php
    • > /wp-content/plugins/map-it-by-two-row-studio/functions/hooks.php
    • > /wp-content/plugins/map-it-by-two-row-studio/admin/functions/metaboxes.php
    • > /wp-content/plugins/map-it-by-two-row-studio/admin/functions/settings.php
    • > /wp-content/plugins/map-it-by-two-row-studio/classes/google/class-map.php
    • > /wp-content/plugins/map-it-by-two-row-studio/admin/functions/setup.php
    • > /wp-content/plugins/map-it-by-two-row-studio/classes/common/class-notices.php
  • 1× 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/map-it-by-two-row-studio/functions/ajax.php:3

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 93% from 29 tests

readme.txt Passed 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
4 plugin tags: extensible, google maps, locations, geolocation

map-it-by-two-row-studio/trs_mapit.php 85% from 13 tests

Analyzing the main PHP file in "Map It! by Two Row Studio" version 1.0.6
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("map-it-by-two-row-studio.php" instead of "trs_mapit.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,833 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP161792521,300
JavaScript27639344
CSS2560189

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity19.00
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods27
▷ Static methods1037.04%
▷ Public methods2281.48%
▷ Protected methods27.41%
▷ Private methods311.11%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.26MB with 0.17MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png51.72KB16.54KB▼ 68.02%
assets/banner-1544x500.png167.69KB51.88KB▼ 69.06%
assets/icon-256x256.png32.31KB11.39KB▼ 64.74%
assets/icon-128x128.png10.32KB4.41KB▼ 57.23%