10% dynamic-cta

Code Review | Dynamic CTA

WordPress plugin Dynamic CTA scored10%from 54 tests.

About plugin

  • Plugin page: dynamic-cta
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.5.2
  • WordPress version: 6.3.1
  • First release: May 17, 2016
  • Latest release: Jun 28, 2016
  • Number of updates: 7
  • Update frequency: every 6.6 days
  • Top authors: gabrielvieira (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /851 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/dynamic-cta/dynamic-ctas.php+199
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.61ms] Passed 4 tests

Server-side resources used by Dynamic CTA
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.52 ▼2.04
Dashboard /wp-admin3.34 ▲0.0449.13 ▲1.12
Posts /wp-admin/edit.php3.40 ▲0.0449.73 ▼1.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0496.42 ▼4.19
Media Library /wp-admin/upload.php3.27 ▲0.0438.59 ▲4.12
All CTA /wp-admin/admin.php?page=dynamic_cta_page3.2932.57
New CTA /wp-admin/post-new.php?post_type=dynamic_cta_type3.4154.67

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_ea_dynamicctas_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Dynamic CTA: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.28 ▼0.071.58 ▼0.0945.15 ▲3.64
Dashboard /wp-admin2,205 ▲255.58 ▼0.0789.37 ▼4.0380.88 ▲39.99
Posts /wp-admin/edit.php2,122 ▲191.97 ▲0.0235.31 ▼1.1738.12 ▼2.92
Add New Post /wp-admin/post-new.php1,561 ▲3123.20 ▲0.07656.92 ▼7.5753.94 ▼5.96
Media Library /wp-admin/upload.php1,419 ▲164.22 ▼0.0497.83 ▼2.1563.41 ▲19.54
All CTA /wp-admin/admin.php?page=dynamic_cta_page8492.1724.2225.71
New CTA /wp-admin/post-new.php?post_type=dynamic_cta_type2,2167.67163.71131.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=dynamic_cta_page
    • > Notice in wp-content/plugins/dynamic-cta/dynamic_ctas_admin.php+4
    Undefined index: order
    • > GET request to /wp-admin/admin.php?page=dynamic_cta_page
    • > Notice in wp-content/plugins/dynamic-cta/dynamic_ctas_admin.php+5
    Undefined index: orderby

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === dynamic-cta === )
Please take inspiration from this readme.txt

dynamic-cta/dynamic-ctas.php 77% from 13 tests

The principal PHP file in "Dynamic CTA" v. 1.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("dynamic-cta.php" instead of "dynamic-ctas.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 168 characters long)

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
Good job! No executable or dangerous file extensions detected381 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33944305
PO File1171872
JavaScript1034

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.31
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.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
2 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/logoDynamicCTA-Full.png14.50KB7.70KB▼ 46.94%
image/logoDynamicCTA.png1.39KB1.37KB▼ 1.40%