88% openspending

Code Review | OpenSpending

WordPress plugin OpenSpending scored 88% from 53 tests.

About plugin

  • Plugin page: openspending
  • Plugin version: 0.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 5.8.1
  • First release: Jan 8, 2014
  • Latest release: Jan 8, 2014
  • Number of updates: 4
  • Update frequency: every 7.0 days
  • Top authors: openspending (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 854 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼281.87ms] Passed 4 tests

A check of server-side resources used by OpenSpending
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1333.77 ▲12.60
Dashboard /wp-admin3.06 ▲0.0141.57 ▼2.72
Posts /wp-admin/edit.php3.11 ▲0.0141.83 ▼4.01
Add New Post /wp-admin/post-new.php5.43 ▼0.0093.58 ▼1,119.08
Media Library /wp-admin/upload.php3.01 ▼0.0034.78 ▼1.65

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 112 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by OpenSpending
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,650 ▲4415.78 ▲0.207.43 ▼0.5253.31 ▲2.75
Dashboard /wp-admin2,931 ▲815.94 ▼0.06157.07 ▲24.41107.45 ▲8.60
Posts /wp-admin/edit.php2,703 ▼32.69 ▼0.1164.24 ▼3.1486.10 ▼9.39
Add New Post /wp-admin/post-new.php1,651 ▼20618.47 ▼0.62345.99 ▼14.08104.33 ▲0.09
Media Library /wp-admin/upload.php1,772 ▼35.01 ▼0.00142.40 ▼10.88113.17 ▼1.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/openspending/code/add-shortcode.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: HTTPS in wp-content/plugins/openspending/code/add-shortcode.php on line 28
    • > PHP Notice
      Undefined index: HTTPS in wp-content/plugins/openspending/code/add-shortcode.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/openspending/openspending.php:46
    • > PHP Notice
      Undefined index: HTTPS in wp-content/plugins/openspending/code/add-shortcode.php on line 28
    • > PHP Notice
      Undefined index: HTTPS in wp-content/plugins/openspending/code/add-shortcode.php on line 28
    • > PHP Notice
      Undefined index: HTTPS in wp-content/plugins/openspending/code/add-shortcode.php on line 28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: data, visualisation, spending, analysis, open data...

openspending/openspending.php 92% from 13 tests

The main file in "OpenSpending" v. 0.5.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 410 characters long)

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 plugin11,588 lines of code in 105 files:
LanguageFilesBlank linesComment linesLines of code
SVG9939911,215
PHP271156294
CSS28046
JavaScript2121533

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods12100.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/barchart-icon.png1.17KB0.82KB▼ 30.01%
img/bubbletree-icon.png2.91KB1.97KB▼ 32.30%
img/treemap-icon.png0.76KB0.51KB▼ 32.35%
img/os.png0.62KB0.75KB0.00%
img/os-icon.png8.00KB7.21KB▼ 9.85%