83% captivate-by-smartasset

Code Review | SmartAsset Captivate

WordPress plugin SmartAsset Captivate scored 83% from 54 tests.

About plugin

  • Plugin page: captivate-by-smar...
  • Plugin version: 0.14.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Jun 2, 2016
  • Latest release: Jun 14, 2017
  • Number of updates: 21
  • Update frequency: every 19.7 days
  • Top authors: mihirapte1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 2,103 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
Install script ran successfully

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

This is a short check of server-side resources used by SmartAsset Captivate
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.61 ▲1.95
Dashboard /wp-admin3.34 ▲0.0345.53 ▲0.51
Posts /wp-admin/edit.php3.39 ▲0.0350.24 ▲3.27
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.79 ▼1.47
Media Library /wp-admin/upload.php3.26 ▲0.0334.05 ▼0.16
SmartAsset Captivate /wp-admin/options-general.php?page=smartasset_plugin3.2331.91

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 11 new options
New WordPress options
sa_allow_auto
sa_advanced
widget_recent-comments
can_compress_scripts
sa_ex_categories
sa_placement
db_upgraded
sa_section
widget_theysaidso_widget
widget_recent-posts
...

Browser metrics Passed 4 tests

Checking browser requirements for SmartAsset Captivate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1513.32 ▲0.124.18 ▲2.6142.65 ▲2.40
Dashboard /wp-admin2,210 ▲45.85 ▲1.02106.29 ▼3.0342.71 ▼1.41
Posts /wp-admin/edit.php2,090 ▼21.97 ▼0.0639.56 ▼0.1034.85 ▼1.83
Add New Post /wp-admin/post-new.php1,536 ▼622.99 ▲4.84636.48 ▲14.5847.09 ▼11.55
Media Library /wp-admin/upload.php1,392 ▲74.22 ▲0.0492.61 ▼6.2442.15 ▼2.43
SmartAsset Captivate /wp-admin/options-general.php?page=smartasset_plugin1,0372.0724.3733.02

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 11 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • sa_allow_auto
    • sa_ex_categories
    • sa_placement
    • sa_section
    • sa_advanced
    • db_upgraded
    • widget_recent-comments
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/captivate-by-smartasset/smartasset-captivate.php:60

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 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === captivate-by-smartasset === )
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

captivate-by-smartasset/smartasset-captivate.php 92% from 13 tests

The principal PHP file in "SmartAsset Captivate" v. 0.14.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("captivate-by-smartasset.php" instead of "smartasset-captivate.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin539 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2140339539

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity36.50
▷ Minimum class complexity14.00
▷ Maximum class complexity59.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods48
▷ Static methods00.00%
▷ Public methods48100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin