78% dima-take-action

Code Review | Dima Take Action

WordPress plugin Dima Take Action scored78%from 54 tests.

About plugin

  • Plugin page: dima-take-action
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Dec 7, 2017
  • Latest release: Aug 7, 2018
  • Number of updates: 11
  • Update frequency: every 22.1 days
  • Top authors: adeltahri (63.64%)pixeldima (45.45%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active /13,058 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲1.42MB] [CPU: ▲7.64ms] Passed 4 tests

This is a short check of server-side resources used by Dima Take Action
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.04 ▲1.5850.38 ▲6.52
Dashboard /wp-admin4.75 ▲1.4458.29 ▲5.15
Posts /wp-admin/edit.php4.80 ▲1.4458.49 ▲9.31
Add New Post /wp-admin/post-new.php7.29 ▲1.40112.16 ▲9.57
Media Library /wp-admin/upload.php4.63 ▲1.4051.35 ▲14.33
Options Object /wp-admin/admin.php?page=DimaTakeAction&tab=95.23268.18
Import / Export /wp-admin/admin.php?page=DimaTakeAction&tab=105.2157.82
Settings /wp-admin/admin.php?page=DimaTakeAction&tab=15.2158.34

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 435 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
dima_ta_demo-transients
dima_ta_demo

Browser metrics Passed 4 tests

Dima Take Action: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲18613.71 ▼0.725.85 ▲3.3739.42 ▼7.19
Dashboard /wp-admin2,244 ▲595.86 ▼0.03114.81 ▲8.9943.21 ▲2.29
Posts /wp-admin/edit.php2,127 ▲382.00 ▼0.0437.11 ▼4.3133.47 ▼4.50
Add New Post /wp-admin/post-new.php1,552 ▲1018.53 ▲0.26616.30 ▼46.6751.18 ▼3.17
Media Library /wp-admin/upload.php1,426 ▲384.25 ▲0.0898.09 ▼4.7943.02 ▼3.72
Options Object /wp-admin/admin.php?page=DimaTakeAction&tab=92,7339.16199.4877.78
Import / Export /wp-admin/admin.php?page=DimaTakeAction&tab=102,7339.12189.86117.33
Settings /wp-admin/admin.php?page=DimaTakeAction&tab=12,8089.72212.57137.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • dima_ta_demo
    • dima_ta_demo-transients
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dima-take-action/admin/partials/dima-take-action-admin-display.php
    • > /wp-content/plugins/dima-take-action/public/partials/dima-take-action-public-display.php
  • 23× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/inc/extensions/customizer/inc/customizer_control.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dima-take-action/admin/class-dima-take-action-admin.php:123
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/templates/panel/container.tpl.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PixelDima_Base' not found in wp-content/plugins/dima-take-action/public/class-dima-take-action-public.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/templates/panel/header_stickybar.tpl.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'themecheck' not found in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/inc/themecheck/checks/embedded.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/inc/welcome/views/extensions.php:64
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/templates/panel/header.tpl.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Panel' not found in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/inc/extensions/customizer/inc/customizer_panel.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'themecheck' not found in wp-content/plugins/dima-take-action/admin/redux-framework/ReduxCore/inc/themecheck/checks/full_package.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (25 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

dima-take-action/dima-take-action.php Passed 13 tests

The entry point to "Dima Take Action" version 1.0.5 is a PHP file that has certain tags in its header comment area
80 characters long description:
Easily lets you add a Top/Buttom Banner to display a notification and promotion.

Code Analysis 97% from 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
No dangerous file extensions were detected39,013 lines of code in 313 files:
LanguageFilesBlank linesComment linesLines of code
PHP1194,0446,14016,954
JavaScript872,6121,97312,106
Sass541,184607,579
SVG100934
JSON11840909
CSS493045449
LESS10053
HTML13029

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity30.41
▷ Minimum class complexity1.00
▷ Maximum class complexity878.00
Average method complexity6.13
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes111
▷ Abstract classes00.00%
▷ Concrete classes111100.00%
▷ Final classes00.00%
Methods638
▷ Static methods11117.40%
▷ Public methods48576.02%
▷ Protected methods9414.73%
▷ Private methods599.25%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants60
▷ Global constants23.33%
▷ Class constants5896.67%
▷ Public constants58100.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
30 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/redux-framework/ReduxCore/assets/img/3-col-portfolio.png1.00KB0.15KB▼ 85.27%
admin/redux-framework/ReduxCore/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
admin/redux-framework/ReduxCore/assets/img/1c.png0.13KB0.13KB▼ 0.72%
admin/redux-framework/ReduxCore/assets/img/2cl.png2.91KB0.24KB▼ 91.79%
admin/redux-framework/ReduxCore/assets/img/3cl.png3.08KB0.33KB▼ 89.13%