84% pdpa-thailand

Code Review | Designil PDPA Thailand

WordPress plugin Designil PDPA Thailand scored84%from 54 tests.

About plugin

  • Plugin page: pdpa-thailand
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 27, 2021
  • Latest release: Aug 11, 2023
  • Number of updates: 25
  • Update frequency: every 37.2 days
  • Top authors: aumkub (100%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active /12,467 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by Designil PDPA Thailand
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1738.83 ▼0.77
Dashboard /wp-admin3.37 ▲0.0748.83 ▼4.21
Posts /wp-admin/edit.php3.42 ▲0.0753.89 ▲1.04
Add New Post /wp-admin/post-new.php5.95 ▲0.0795.07 ▼10.50
Media Library /wp-admin/upload.php3.30 ▲0.0737.64 ▼5.49
Cookie Scanner (PRO) /wp-admin/admin.php?page=pdpa-thailand-scanner3.2632.52
PDPA Thailand /wp-admin/admin.php?page=pdpa-thailand3.2938.86

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 46 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
pdpa_thailand_settings
can_compress_scripts
pdpa_thailand_installed
db_upgraded
pdpa_thailand_msg
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Designil PDPA Thailand
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15514.26 ▼0.014.76 ▲3.1370.80 ▲27.97
Dashboard /wp-admin2,227 ▲475.62 ▼0.0491.02 ▲3.1743.28 ▲2.37
Posts /wp-admin/edit.php2,129 ▲262.02 ▲0.0839.32 ▼0.9537.72 ▲1.27
Add New Post /wp-admin/post-new.php1,559 ▲3123.09 ▲0.00609.46 ▼19.6749.99 ▼5.98
Media Library /wp-admin/upload.php1,432 ▲294.19 ▼0.0298.01 ▼9.4441.46 ▼4.92
Cookie Scanner (PRO) /wp-admin/admin.php?page=pdpa-thailand-scanner8202.0024.2726.19
PDPA Thailand /wp-admin/admin.php?page=pdpa-thailand1,4013.1140.5663.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PDPA_THAILAND_Public' not found in wp-content/plugins/pdpa-thailand/template/popup.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PDPA_THAILAND_Public' not found in wp-content/plugins/pdpa-thailand/template/sidebar.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
7 plugin tags: law, thai, pdpa, thailand, cookie...

pdpa-thailand/pdpa-thailand.php Passed 13 tests

The main PHP script in "Designil PDPA Thailand" version 1.2.4 is automatically included on every request by WordPress
84 characters long description:
Support Thai PDPA law by manage cookie systematic and allow to ask consent from user

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin3,623 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP92922041,515
Sass21616861
JavaScript611198381
SVG12154356
CSS3368320
PO File16975190

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity29.25
▷ Minimum class complexity2.00
▷ Maximum class complexity92.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods56100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 compressed PNG files occupy 0.02MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/logo.png6.85KB5.83KB▼ 14.90%
admin/assets/images/info-max-container-size.png5.66KB5.16KB▼ 8.70%
admin/assets/images/info-logo.png8.31KB6.92KB▼ 16.68%