78% godni

Code Review | GoDNI

WordPress plugin GoDNI scored78%from 54 tests.

About plugin

  • Plugin page: godni
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.0.1
  • WordPress version: 6.3.1
  • First release: Oct 17, 2013
  • Latest release: Oct 17, 2013
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: gonzalesc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /981 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.39ms] Passed 4 tests

An overview of server-side resources used by GoDNI
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.56 ▼7.98
Dashboard /wp-admin3.34 ▲0.0449.09 ▼1.47
Posts /wp-admin/edit.php3.39 ▲0.0350.20 ▼0.39
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.41 ▲0.29
Media Library /wp-admin/upload.php3.26 ▲0.0335.99 ▲0.50
Setting GoDNI /wp-admin/users.php?page=godni3.3129.60

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
godni_column
widget_theysaidso_widget
db_upgraded
godni_register
godni_profile

Browser metrics Passed 4 tests

This is an overview of browser requirements for GoDNI
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.25 ▲0.051.69 ▼0.0342.40 ▼1.59
Dashboard /wp-admin2,199 ▲255.61 ▲0.0790.70 ▼16.1238.63 ▼3.84
Posts /wp-admin/edit.php2,101 ▲11.98 ▲0.0235.92 ▼0.2333.44 ▼4.31
Add New Post /wp-admin/post-new.php1,531 ▲323.27 ▲0.04643.44 ▼54.3572.25 ▲16.54
Media Library /wp-admin/upload.php1,401 ▲44.24 ▼0.02100.82 ▼3.4541.88 ▼3.92
Setting GoDNI /wp-admin/users.php?page=godni8722.0427.3328.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • godni_profile
    • godni_column
    • db_upgraded
    • godni_register
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/godni/godni-settings.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/godni/index.php on line 14
    • > PHP Notice
      Undefined variable: godni_profile in wp-content/plugins/godni/godni-settings.php on line 22
    • > PHP Notice
      Undefined variable: godni_column in wp-content/plugins/godni/godni-settings.php on line 30
    • > PHP Notice
      Undefined variable: godni_column in wp-content/plugins/godni/godni-settings.php on line 31
    • > PHP Notice
      Undefined variable: godni_profile in wp-content/plugins/godni/godni-settings.php on line 21
    • > PHP Notice
      Undefined variable: godni_register in wp-content/plugins/godni/godni-settings.php on line 13
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/godni/godni.class.php): failed to open stream: No such file or directory in wp-content/plugins/godni/index.php on line 14
    • > PHP Notice
      Undefined variable: godni_register in wp-content/plugins/godni/godni-settings.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/godni/godni.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/godni/index.php on line 14

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: peruvian dni, person, trunk

godni/index.php 92% from 13 tests

"GoDNI" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("godni.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected189 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34950189

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin