84% the-joshua-project-nation-info

Code Review | The Joshua Project, Nation Info

WordPress plugin The Joshua Project, Nation Info scored84%from 54 tests.

About plugin

  • Plugin page: the-joshua-projec...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2
  • WordPress version: 6.3.1
  • First release: Oct 6, 2014
  • Latest release: May 13, 2019
  • Number of updates: 7
  • Update frequency: every 240.6 days
  • Top authors: topher1kenobe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,531 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼8.38ms] Passed 4 tests

A check of server-side resources used by The Joshua Project, Nation Info
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1036.78 ▼4.27
Dashboard /wp-admin3.40 ▲0.0644.08 ▼15.68
Posts /wp-admin/edit.php3.45 ▲0.1046.54 ▼2.55
Add New Post /wp-admin/post-new.php5.98 ▲0.1092.91 ▼11.00
Media Library /wp-admin/upload.php3.32 ▲0.1036.55 ▲2.51

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 252 new files
Database: no new tables, 7 new options
New WordPress options
widget_joshua-project-country-info-widget
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for The Joshua Project, Nation Info
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.074.89 ▲3.1938.13 ▼4.24
Dashboard /wp-admin2,200 ▲95.80 ▲0.88107.80 ▼6.3937.62 ▼7.43
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0439.73 ▼1.5835.67 ▲0.53
Add New Post /wp-admin/post-new.php1,533 ▲523.51 ▲5.10681.59 ▲22.8772.20 ▲17.36
Media Library /wp-admin/upload.php1,382 ▲34.18 ▼0.09101.40 ▼1.6942.26 ▼6.34

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_joshua-project-country-info-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/the-joshua-project-nation-info/joshua-project-country-info.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/the-joshua-project-nation-info/includes/country-widget.class.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: You can look at the official readme.txt

the-joshua-project-nation-info/joshua-project-country-info.php 92% from 13 tests

"The Joshua Project, Nation Info" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("the-joshua-project-nation-info.php" instead of "joshua-project-country-info.php")

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 plugin424 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP388113424

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.50
▷ Minimum class complexity4.00
▷ Maximum class complexity35.00
Average method complexity5.11
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.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 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin