78% wp-opendata

Code Review | WP OpenData

WordPress plugin WP OpenData scored78%from 54 tests.

About plugin

  • Plugin page: wp-opendata
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.2.3
  • WordPress version: 6.3.1
  • First release: Sep 16, 2013
  • Latest release: Aug 2, 2015
  • Number of updates: 5
  • Update frequency: every 137.6 days
  • Top authors: marthijn1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,375 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.33MB] [CPU: ▼8.02ms] Passed 4 tests

This is a short check of server-side resources used by WP OpenData
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2950.05 ▲14.60
Dashboard /wp-admin3.68 ▲0.3753.07 ▲6.69
Posts /wp-admin/edit.php3.73 ▲0.3747.59 ▲2.43
Add New Post /wp-admin/post-new.php3.52 ▼2.3639.49 ▼48.52
Media Library /wp-admin/upload.php3.60 ▲0.3741.07 ▲7.32
Data Formats /wp-admin/edit-tags.php?taxonomy=opendata-data-format&post_type=dataset3.6146.30
Organizations /wp-admin/edit-tags.php?taxonomy=opendata-organization-owner&post_type=dataset3.5941.59
All Project /wp-admin/edit.php?post_type=project3.6439.82
All Datasets /wp-admin/edit.php?post_type=dataset3.6439.32
Tags /wp-admin/edit-tags.php?taxonomy=opendata-tags&post_type=project3.5937.13
Categories /wp-admin/edit-tags.php?taxonomy=opendata-category&post_type=project3.5939.12
Add New /wp-admin/post-new.php?post_type=dataset3.5238.05
Categories /wp-admin/edit-tags.php?taxonomy=opendata-category&post_type=dataset3.5940.22
WP OpenData /wp-admin/options-general.php?page=wp-opendata-settings3.6139.76
Tags /wp-admin/edit-tags.php?taxonomy=opendata-tags&post_type=dataset3.5940.16

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
opendata-data-format_children
db_upgraded

Browser metrics Passed 4 tests

WP OpenData: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲11814.14 ▼0.211.81 ▲0.1743.71 ▼0.06
Dashboard /wp-admin2,277 ▲1005.61 ▼0.0492.95 ▲6.4341.66 ▲1.05
Posts /wp-admin/edit.php2,182 ▲822.04 ▲0.0334.91 ▲0.9132.61 ▼6.12
Add New Post /wp-admin/post-new.php1,593 ▲6523.08 ▲0.05679.63 ▲47.3455.99 ▲7.92
Media Library /wp-admin/upload.php1,479 ▲764.19 ▼0.0395.12 ▼2.0543.09 ▼0.86
Data Formats /wp-admin/edit-tags.php?taxonomy=opendata-data-format&post_type=dataset2,0842.1330.3048.75
Organizations /wp-admin/edit-tags.php?taxonomy=opendata-organization-owner&post_type=dataset1,3282.2426.5332.22
All Project /wp-admin/edit.php?post_type=project1,2021.9731.3531.29
All Datasets /wp-admin/edit.php?post_type=dataset1,2181.9130.4629.75
Tags /wp-admin/edit-tags.php?taxonomy=opendata-tags&post_type=project1,3312.1225.9029.18
Categories /wp-admin/edit-tags.php?taxonomy=opendata-category&post_type=project1,3532.1226.8628.76
Add New /wp-admin/post-new.php?post_type=dataset3,2608.01173.1371.39
Categories /wp-admin/edit-tags.php?taxonomy=opendata-category&post_type=dataset1,3532.2528.3131.13
WP OpenData /wp-admin/options-general.php?page=wp-opendata-settings1,6715.66102.7953.74
Tags /wp-admin/edit-tags.php?taxonomy=opendata-tags&post_type=dataset1,3252.1227.7829.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • opendata-data-format_children

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=dataset
    • > Notice in wp-content/plugins/wp-opendata/admin.php+570
    Undefined index: post_type

SRP 50% 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
Please take a closer look at the following
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function query_posts() in wp-content/plugins/wp-opendata/templates/single-project.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function query_posts() in wp-content/plugins/wp-opendata/templates/single-dataset.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/wp-opendata/export.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_class() in wp-content/plugins/wp-opendata/templates/content-dataset.php:8
    • > PHP Warning
      array_merge(): Expected parameter 1 to be an array, null given in wp-content/plugins/wp-opendata/templates/single-project.php on line 9
    • > PHP Warning
      array_merge(): Expected parameter 1 to be an array, null given in wp-content/plugins/wp-opendata/templates/single-dataset.php on line 9
    • > PHP Notice
      Trying to get property 'query_vars' of non-object in wp-content/plugins/wp-opendata/templates/single-project.php on line 9
    • > PHP Warning
      Use of undefined constant get_the_term_list - assumed 'get_the_term_list' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-opendata/templates/content-dataset.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_class() in wp-content/plugins/wp-opendata/templates/content-project.php:8
    • > PHP Warning
      Use of undefined constant get_the_term_list - assumed 'get_the_term_list' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-opendata/templates/content-project.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: opendata

wp-opendata/wp-opendata.php 85% from 13 tests

The principal PHP file in "WP OpenData" v. 1.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,950 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP82492671,512
PO File1180417418
CSS21120

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin