74% reporting-api

Code Review | Reporting API

WordPress plugin Reporting API scored74%from 54 tests.

About plugin

  • Plugin page: reporting-api
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.1
  • WordPress version: 6.3.1
  • First release: Mar 5, 2019
  • Latest release: Mar 15, 2019
  • Number of updates: 6
  • Update frequency: every 2.0 days
  • Top authors: flixos90 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,213 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.15MB] [CPU: ▼12.01ms] Passed 4 tests

This is a short check of server-side resources used by Reporting API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3236.55 ▼3.03
Dashboard /wp-admin3.57 ▲0.2747.06 ▲0.32
Posts /wp-admin/edit.php3.69 ▲0.3346.87 ▲2.93
Add New Post /wp-admin/post-new.php4.52 ▼1.3741.29 ▼48.27
Media Library /wp-admin/upload.php3.43 ▲0.2038.76 ▲6.24
Reporting API /wp-admin/tools.php?page=reporting_api_reports3.5836.19

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 123 new files
Database: 2 new tables, 6 new options
New tables
wp_ra_reports
wp_ra_report_logs
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Reporting API: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.22 ▼1.524.48 ▲2.6341.37 ▲0.14
Dashboard /wp-admin2,254 ▲695.04 ▼0.96105.93 ▲5.0741.78 ▼0.42
Posts /wp-admin/edit.php2,093 ▲42.06 ▼0.0136.75 ▲1.1935.17 ▲0.84
Add New Post /wp-admin/post-new.php1,516 ▼1717.62 ▼5.79614.65 ▼46.1250.20 ▼10.57
Media Library /wp-admin/upload.php1,392 ▲14.21 ▼0.0397.67 ▼2.4041.36 ▼1.44
Reporting API /wp-admin/tools.php?page=reporting_api_reports1,0361.8524.5831.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_ra_report_logs
    • wp_ra_reports
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 91× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/reporting-api/reporting-api.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/reporting-api/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/reporting-api/src/Admin/Reports_List_Table.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 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
2 plugin tags: api, reporting

reporting-api/reporting-api.php Passed 13 tests

Analyzing the main PHP file in "Reporting API" version 0.1.1
76 characters long description:
WordPress plugin for receiving browser reports via a Reporting API endpoint.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected4,486 lines of code in 118 files:
LanguageFilesBlank linesComment linesLines of code
PHP1161,0022,3224,257
JSON200229

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity4.53
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes110
▷ Abstract classes10.91%
▷ Concrete classes10999.09%
▷ Final classes00.00%
Methods227
▷ Static methods52.20%
▷ Public methods14463.44%
▷ Protected methods7533.04%
▷ Private methods83.52%
Functions27
▷ Named functions622.22%
▷ Anonymous functions2177.78%
Constants13
▷ Global constants00.00%
▷ Class constants13100.00%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin