84% taro-ad-fields

Code Review | Taro Ad Fields

WordPress plugin Taro Ad Fields scored84%from 54 tests.

About plugin

  • Plugin page: taro-ad-fields
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Jul 31, 2017
  • Latest release: Oct 15, 2017
  • Number of updates: 8
  • Update frequency: every 9.9 days
  • Top authors: Takahashi_Fumiki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /966 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by Taro Ad Fields
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1639.99 ▼0.71
Dashboard /wp-admin3.45 ▲0.1548.51 ▲1.57
Posts /wp-admin/edit.php3.57 ▲0.2145.66 ▼0.03
Add New Post /wp-admin/post-new.php6.04 ▲0.1598.89 ▼3.70
Media Library /wp-admin/upload.php3.38 ▲0.1536.11 ▲4.13
Add New /wp-admin/post-new.php?post_type=ad-content3.5047.98
Ad Fields /wp-admin/edit.php?post_type=ad-content3.4237.90
Positions /wp-admin/edit-tags.php?taxonomy=ad-position&post_type=ad-content3.3733.82

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 387 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_taf-widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Taro Ad Fields
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9813.15 ▼1.654.46 ▲2.6542.52 ▼1.61
Dashboard /wp-admin2,244 ▲625.84 ▲0.76101.27 ▼9.5639.82 ▲0.10
Posts /wp-admin/edit.php2,129 ▲432.05 ▲0.0734.94 ▼4.0732.33 ▼4.30
Add New Post /wp-admin/post-new.php1,564 ▲2223.51 ▲5.27585.81 ▼53.3847.21 ▼8.74
Media Library /wp-admin/upload.php1,432 ▲414.27 ▲0.0399.45 ▼2.0544.35 ▼0.89
Add New /wp-admin/post-new.php?post_type=ad-content2,5659.32237.5591.76
Ad Fields /wp-admin/edit.php?post_type=ad-content1,1091.9331.6331.94
Positions /wp-admin/edit-tags.php?taxonomy=ad-position&post_type=ad-content1,2912.2830.1831.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_taf-widget
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/taro-ad-fields/includes/iframe.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/taro-ad-fields/includes/post_type.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/taro-ad-fields/includes/ouput.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/taro-ad-fields/includes/meta-box.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/taro-ad-fields/taro-ad-fields.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/taro-ad-fields/includes/TafWidget.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: advertisement

taro-ad-fields/taro-ad-fields.php 92% from 13 tests

"Taro Ad Fields" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin235,003 lines of code in 380 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript36124,10316,678233,851
PHP14113340849
PO File14747148
Markdown134082
Sass19171
CSS1111
JSON1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity15.50
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods28
▷ Static methods310.71%
▷ Public methods2796.43%
▷ Protected methods00.00%
▷ Private methods13.57%
Functions31
▷ Named functions1032.26%
▷ Anonymous functions2167.74%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected