78% look-inside-pdf

Code Review | Look Inside PDF

WordPress plugin Look Inside PDF scored78%from 54 tests.

About plugin

  • Plugin page: look-inside-pdf
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.3
  • WordPress version: 6.3.1
  • First release: Nov 18, 2020
  • Latest release: Nov 18, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: kapilpaul (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /586 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.17ms] Passed 4 tests

Analyzing server-side resources used by Look Inside PDF
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.32 ▼0.64
Dashboard /wp-admin3.33 ▲0.0245.84 ▲0.71
Posts /wp-admin/edit.php3.38 ▲0.0249.44 ▼2.57
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.51 ▼14.17
Media Library /wp-admin/upload.php3.25 ▲0.0235.96 ▲2.06

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 43 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
db_upgraded
look_inside_pdf_installed
widget_theysaidso_widget
look_inside_pdf_version
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Look Inside PDF
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.64 ▼0.921.73 ▼0.3742.91 ▲1.67
Dashboard /wp-admin2,231 ▲464.86 ▲0.04112.78 ▲10.0843.37 ▼3.38
Posts /wp-admin/edit.php2,117 ▲252.01 ▼0.0442.44 ▼4.4035.44 ▼0.48
Add New Post /wp-admin/post-new.php1,558 ▲1623.68 ▲5.53642.70 ▲29.6466.64 ▲10.93
Media Library /wp-admin/upload.php1,416 ▲314.32 ▲0.1697.83 ▼7.4744.79 ▼0.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • look_inside_pdf_version
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • look_inside_pdf_installed

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/look-inside-pdf/templates/product/after-add-to-cart.php
    • > /wp-content/plugins/look-inside-pdf/templates/product/single.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: show_on_product_thumb in wp-content/plugins/look-inside-pdf/templates/product/single.php on line 2
    • > PHP Notice
      Undefined variable: li_pdf_images in wp-content/plugins/look-inside-pdf/templates/product/single.php on line 47
    • > PHP Notice
      Undefined variable: lipdf_show_read_more_button_after_product_thumb in wp-content/plugins/look-inside-pdf/templates/product/single.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/look-inside-pdf/templates/admin/settings.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/look-inside-pdf/templates/product/single.php on line 47
    • > PHP Notice
      Undefined variable: lipdf_read_more_button_text in wp-content/plugins/look-inside-pdf/templates/product/after-add-to-cart.php on line 2
    • > PHP Notice
      Undefined variable: show_on_product_thumb in wp-content/plugins/look-inside-pdf/templates/product/single.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/look-inside-pdf/templates/admin/product/options.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Requires php: The plugin version is formatted incorrectly
Please take inspiration from this readme.txt

look-inside-pdf/look-inside-pdf.php 92% from 13 tests

The main PHP file in "Look Inside PDF" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Git Repository: A Git repository was detected inside this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected3,074 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP296971,1962,517
CSS2408196
Markdown1660181
JSON300100
JavaScript2241180

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.81
▷ Minimum class complexity1.00
▷ Maximum class complexity70.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits1
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes16.67%
Methods163
▷ Static methods159.20%
▷ Public methods12375.46%
▷ Protected methods63.68%
▷ Private methods3420.86%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin