94% doi-creator

Code Review | DOI Creator

WordPress plugin DOI Creator scored 94% from 54 tests.

About plugin

  • Plugin page: doi-creator
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7.2
  • WordPress version: 5.8.1
  • First release: Jul 27, 2021
  • Latest release: Jul 27, 2021
  • Number of updates: 2
  • Update frequency: every 9.5 days
  • Top authors: ghego1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 78 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
Install script ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼139.69ms] Passed 4 tests

This is a short check of server-side resources used by DOI Creator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2036.83 ▲11.03
Dashboard /wp-admin3.22 ▲0.1741.88 ▼2.74
Posts /wp-admin/edit.php3.27 ▲0.1641.17 ▼3.99
Add New Post /wp-admin/post-new.php5.52 ▲0.0889.16 ▼552.97
Media Library /wp-admin/upload.php3.10 ▲0.1032.49 ▲0.93
DOI creator settings /wp-admin/options-general.php?page=doi-creator-plugin3.0728.54

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for DOI Creator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8816.17 ▲0.607.73 ▼1.2249.26 ▲2.96
Dashboard /wp-admin2,975 ▲415.87 ▼0.04134.60 ▼4.78107.46 ▲2.21
Posts /wp-admin/edit.php2,744 ▲52.68 ▼0.0267.68 ▼3.91103.13 ▲10.81
Add New Post /wp-admin/post-new.php1,675 ▲9418.70 ▼1.70369.77 ▼17.08106.01 ▼18.18
Media Library /wp-admin/upload.php1,812 ▲55.01 ▼0.02150.52 ▲11.09113.65 ▼10.28
DOI creator settings /wp-admin/options-general.php?page=doi-creator-plugin1,1332.0559.1194.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DoiCreator\\Settings\\add_action() in wp-content/plugins/doi-creator/settings/settings_page.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DoiCreator\\plugin_dir_path() in wp-content/plugins/doi-creator/index.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DoiCreator\\Curl\\CurlBase' not found in wp-content/plugins/doi-creator/curl/doi_getter.class.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DoiCreator\\Curl\\CurlBase' not found in wp-content/plugins/doi-creator/curl/new_doi_poster.class.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: digital object identifier, doi, datacite

doi-creator/index.php 92% from 13 tests

The main PHP script in "DOI Creator" version 1.0.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("doi-creator.php" instead of "index.php")

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
Success! There were no dangerous files found in this plugin415 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP1012528415

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.43
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods411.76%
▷ Public methods617.65%
▷ Protected methods25.88%
▷ Private methods2676.47%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected