67% dmopress

Code Review | DMOPress

WordPress plugin DMOPress scored67%from 54 tests.

About plugin

  • Plugin page: dmopress
  • Plugin version: 2.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8.0
  • WordPress version: 6.3.1
  • First release: Mar 27, 2017
  • Latest release: Jul 19, 2017
  • Number of updates: 11
  • Update frequency: every 10.0 days
  • Top authors: jasonpomerleau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,251 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.19MB] [CPU: ▼27.52ms] Passed 4 tests

This is a short check of server-side resources used by DMOPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4630.48 ▼12.24
Dashboard /wp-admin3.85 ▲0.5151.49 ▼13.16
Posts /wp-admin/edit.php3.91 ▲0.5651.66 ▲0.92
Add New Post /wp-admin/post-new.php3.69 ▼2.2039.08 ▼85.59
Media Library /wp-admin/upload.php3.71 ▲0.4839.12 ▲3.31
Place Categories /wp-admin/edit-tags.php?taxonomy=categories&post_type=places3.7138.24
Place Features /wp-admin/edit-tags.php?taxonomy=features&post_type=places3.7139.19
Place Categories /wp-admin/edit-tags.php?taxonomy=categories3.7137.29
Places /wp-admin/edit.php?post_type=places3.7743.22
Add New Place /wp-admin/post-new.php?post_type=places3.6940.61
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=places3.7139.31
DMOPress /wp-admin/options-general.php?page=dmopress-settings3.6634.81

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 67 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_weather_inline
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

DMOPress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8514.35 ▲0.192.36 ▲0.8040.75 ▼0.75
Dashboard /wp-admin2,236 ▲595.51 ▼0.1985.94 ▼19.3536.60 ▼18.51
Posts /wp-admin/edit.php2,164 ▲641.97 ▲0.0037.16 ▲0.9333.84 ▼2.55
Add New Post /wp-admin/post-new.php1,569 ▲4323.03 ▼0.31641.85 ▼33.1054.34 ▼4.56
Media Library /wp-admin/upload.php1,444 ▲444.20 ▲0.06102.55 ▼5.1144.26 ▼5.61
Place Categories /wp-admin/edit-tags.php?taxonomy=categories&post_type=places1,3182.1227.0531.21
Place Features /wp-admin/edit-tags.php?taxonomy=features&post_type=places1,3212.1227.8730.02
Place Categories /wp-admin/edit-tags.php?taxonomy=categories1,3242.1229.2131.82
Places /wp-admin/edit.php?post_type=places1,1672.1030.6732.45
Add New Place /wp-admin/post-new.php?post_type=places1,62017.75903.5132.59
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=places1,3662.1227.6429.49
DMOPress /wp-admin/options-general.php?page=dmopress-settings9612.0023.6730.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_weather_inline

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=places
    • > User notice in wp-includes/functions.php+5905
    Function register_taxonomy was called incorrectly. The "categories" taxonomy "name" property (categories) conflicts with an existing property on the REST API Posts Controller. Specify a custom "rest_base" when registering the taxonomy to avoid this error. Please see Debugging in WordPress for more information. (This message was added in version 5.4.0.)
  • 19 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dmopress-settings
    • > Notice in wp-content/plugins/dmopress/setup/settings.php+185
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 17× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/dmopress/shortcodes/tripadvisor-reviews-button/tripadvisor-reviews-button.php
    • > /wp-content/plugins/dmopress/setup/taxonomies.php
    • > /wp-content/plugins/dmopress/shortcodes/tripadvisor-featured-button/tripadvisor-featured-button.php
    • > /wp-content/plugins/dmopress/shortcodes/tripadvisor-rating-badge/tripadvisor-rating-badge.php
    • > /wp-content/plugins/dmopress/shortcodes/tripadvisor-review-starter/tripadvisor-review-starter.php
    • > /wp-content/plugins/dmopress/shortcodes/weather-current-inline/weather-current-inline.php
    • > /wp-content/plugins/dmopress/integration/tribe-events-calendar/tribe-events-calendar.php
    • > /wp-content/plugins/dmopress/setup/admin.php
    • > /wp-content/plugins/dmopress/includes/classes/dmopress-template-loader.php
    • > /wp-content/plugins/dmopress/functions/private.php
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_title() in wp-content/plugins/dmopress/templates/place-jsonld.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dmo_get_address_full() in wp-content/plugins/dmopress/templates/place-tag.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dmopress/setup/hooks.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function tribe_get_linked_posts() in wp-content/plugins/dmopress/templates/tribe-eventdetail.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dmo_get_address_full() in wp-content/plugins/dmopress/templates/place-feature.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function tribe_get_linked_posts() in wp-content/plugins/dmopress/templates/tribe-aftereventmeta.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dmo_get_address_full() in wp-content/plugins/dmopress/templates/place-archive.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dmo_get_website_url() in wp-content/plugins/dmopress/templates/place-detail.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dmopress/setup/public.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dmopress/shortcodes/twitter-timeline/twitter-timeline.php:57

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
    • > GET request to /wp-admin/post-new.php?post_type=places
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key&ver=6.3.1 210:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: places, directory, dmo, tourism, maps

dmopress/dmopress.php Passed 13 tests

This is the main PHP file of "DMOPress" version 2.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
127 characters long description:
Built specifically for Destination Marketing Organizations, DMOPress helps you show, share and promote your places of interest.

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
There were no executable files found in this plugin6,703 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
CSS41,021432,893
PHP314404242,777
JSON700571
SVG200458
JavaScript2004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.75
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods2086.96%
▷ Protected methods313.04%
▷ Private methods00.00%
Functions75
▷ Named functions7397.33%
▷ Anonymous functions22.67%
Constants6
▷ Global constants6100.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
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
integration/visual-composer/icon-weather-inline.png2.07KB1.21KB▼ 41.60%
shortcodes/map/img/location.png0.53KB0.49KB▼ 6.85%
shortcodes/map/themes/gotham/marker.png4.63KB2.71KB▼ 41.52%
shortcodes/map/themes/grayscale/marker.png4.31KB2.70KB▼ 37.40%
integration/visual-composer/icon-map.png1.70KB0.96KB▼ 43.47%