62% mapfig-studio

Code Review | MapFig Studio

WordPress plugin MapFig Studio scored62%from 54 tests.

About plugin

  • Plugin page: mapfig-studio
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Jun 25, 2015
  • Latest release: Jun 22, 2016
  • Number of updates: 31
  • Update frequency: every 11.7 days
  • Top authors: MapFig (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,322 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.92ms] Passed 4 tests

This is a short check of server-side resources used by MapFig Studio
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1042.20 ▼1.92
Dashboard /wp-admin3.42 ▲0.0850.31 ▼17.28
Posts /wp-admin/edit.php3.53 ▲0.1749.76 ▲1.52
Add New Post /wp-admin/post-new.php6.00 ▲0.1186.19 ▼2.01
Media Library /wp-admin/upload.php3.35 ▲0.1237.21 ▲2.31
Settings /wp-admin/admin.php?page=studio_settings3.3233.53
Social Share /wp-admin/admin.php?page=studio_social_share3.3433.70
MapFig Studio /wp-admin/admin.php?page=studio3.3332.03
Documentation /wp-admin/admin.php?page=studio_documentation3.3331.93
My Studio Maps /wp-admin/admin.php?page=studio_my_maps3.3233.01
Social Settings /wp-admin/admin.php?page=studio_social_share_settings3.3234.34

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 738 new files
Database: 1 new table, 8 new options
New tables
wp_studio_map
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_studio-widget
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
mapfig_studio_db_version

Browser metrics Passed 4 tests

MapFig Studio: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,019 ▲25813.47 ▼0.898.90 ▲7.1342.53 ▼0.91
Dashboard /wp-admin2,330 ▲1505.58 ▼0.0984.91 ▼15.2140.15 ▼1.84
Posts /wp-admin/edit.php2,246 ▲1462.01 ▲0.0435.12 ▼1.5430.87 ▼3.56
Add New Post /wp-admin/post-new.php1,658 ▲12018.64 ▼4.70628.31 ▼52.5170.81 ▲8.78
Media Library /wp-admin/upload.php1,548 ▲1484.24 ▼0.16100.12 ▼9.8942.22 ▼6.46
Settings /wp-admin/admin.php?page=studio_settings1,2892.8542.1163.07
Social Share /wp-admin/admin.php?page=studio_social_share1,9423.9874.6143.06
MapFig Studio /wp-admin/admin.php?page=studio1,3522.8236.3249.85
Documentation /wp-admin/admin.php?page=studio_documentation1,3522.7933.2934.96
My Studio Maps /wp-admin/admin.php?page=studio_my_maps1,3072.8835.0039.24
Social Settings /wp-admin/admin.php?page=studio_social_share_settings1,4202.8737.0935.96

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_studio_map
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • mapfig_studio_db_version
    • widget_studio-widget
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 44× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/config/hooks.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Hooks.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Exceptions.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/config/routes.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/system/libraries/Upload.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/config/foreign_chars.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/config/migration.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/config/profiler.php
    • > /wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/system/core/Benchmark.php
    • > /wp-content/plugins/mapfig-studio/views/include/footer-small.php
  • 37× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mapfig-studio/views/social_share.php:8
    • > PHP Warning
      Use of undefined constant GOOGLEPLUS_URL - assumed 'GOOGLEPLUS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-studio/views/include/footer-small.php on line 96
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/views/ajax_upload_result.php on line 9
    • > PHP Warning
      Use of undefined constant TWITTER_URL - assumed 'TWITTER_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-studio/views/include/footer-small.php on line 93
    • > PHP Notice
      Undefined variable: filepath in wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_php.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mapfig-studio/include/shortcode/functions.php:44
    • > PHP Warning
      Use of undefined constant STUDIO_PLUGIN_NAME_FORMATED - assumed 'STUDIO_PLUGIN_NAME_FORMATED' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapfig-studio/views/social_share_settings.php on line 5
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/views/ajax_upload_result.php on line 20
    • > PHP Notice
      Undefined variable: line in wp-content/plugins/mapfig-studio/tinymce/js/tinymce/plugins/jbimages/ci/application/errors/error_php.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mapfig-studio/include/studioFunctions.php:142

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=studio_social_share_settings
    • > Network (severe)
    wp-content/plugins/mapfig-studio/js/jquery.SelectTag.js?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% 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
9 plugin tags: maps, bing maps, openstreetmap, google maps, leaflet...

mapfig-studio/plugin.php 92% from 13 tests

The main file in "MapFig Studio" v. 0.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mapfig-studio.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin77,061 lines of code in 452 files:
LanguageFilesBlank linesComment linesLines of code
CSS11388197051,480
JavaScript991,8979837,685
PHP701,8064,7066,701
Sass474631904,473
SVG10002,074
LESS142341061,594
HTML251723121,534
JSON12120590
XML4801453
Markdown112160449
YAML34528

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity39.00
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods222
▷ Static methods10.45%
▷ Public methods19386.94%
▷ Protected methods229.91%
▷ Private methods73.15%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants39
▷ Global constants39100.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
67 PNG files occupy 2.39MB with 1.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bootflat/img/github.png5.86KB2.95KB▼ 49.68%
bootflat/img/feature-bootstrap.png4.12KB3.76KB▼ 8.63%
images/share/email.png95.45KB27.20KB▼ 71.50%
bootflat/img/feature-lightweight.png6.53KB5.05KB▼ 22.75%
screenshots/map-options.png131.00KB18.11KB▼ 86.18%