10% simple-pdf-bar

Code Review | Simple PDF bar

WordPress plugin Simple PDF bar scored10%from 54 tests.

About plugin

  • Plugin page: simple-pdf-bar
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Jun 2, 2015
  • Latest release: Jun 8, 2015
  • Number of updates: 12
  • Update frequency: every 0.5 days
  • Top authors: andreasbutze (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,600 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure had errors
    • > Compile error in wp-content/plugins/simple-pdf-bar/validate-fields-and-input.php+10
    Cannot redeclare sanitize_hex_color() (previously declared in wp-includes/formatting.php:6201)

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.54ms] Passed 4 tests

An overview of server-side resources used by Simple PDF bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.81 ▼0.69
Dashboard /wp-admin3.31 ▲0.0047.33 ▼6.60
Posts /wp-admin/edit.php3.36 ▲0.0046.84 ▼3.38
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.07 ▼11.47
Media Library /wp-admin/upload.php3.23 ▲0.0035.06 ▲2.30

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Simple PDF bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▲0.021.59 ▼0.0139.60 ▲0.15
Dashboard /wp-admin2,192 ▲215.56 ▼0.0082.51 ▼0.5139.26 ▼5.27
Posts /wp-admin/edit.php2,100 ▼31.99 ▲0.0133.76 ▼1.3035.25 ▲1.56
Add New Post /wp-admin/post-new.php1,526 ▼522.91 ▲0.17655.97 ▼33.2551.65 ▼4.88
Media Library /wp-admin/upload.php1,397 ▼34.21 ▲0.0195.07 ▼4.3441.84 ▼6.58

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • 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
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
The following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-pdf-bar/define-fields-and-settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-pdf-bar/validate-fields-and-input.php:169
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-pdf-bar/simple-pdf-bar.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/simple-pdf-bar/templates/pdf_lead_template.php:2

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

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Admin page - Where each individual PDF is uploaded and the PDF bar is configured), #2 (PDF view - The PDF with the PDF bar activated)
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === simple-pdf-bar === )
The official readme.txt is a good inspiration

simple-pdf-bar/simple-pdf-bar.php Passed 13 tests

The principal PHP file in "Simple PDF bar" v. 1.0.2 is loaded by WordPress automatically on each request
50 characters long description:
Add a simple lead generation bar to your PDF-files

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin545 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP46774383
CSS216091
JavaScript219871

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.29MB with 0.14MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png201.66KB73.98KB▼ 63.31%
images/close_btn.png1.19KB0.31KB▼ 74.16%
images/checkmark.png0.58KB0.58KB0.00%
screenshot-1.png92.52KB37.04KB▼ 59.96%