84% upprev

Code Review | upPrev

WordPress plugin upPrev scored84%from 54 tests.

About plugin

  • Plugin page: upprev
  • Plugin version: 4.0.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 11, 2011
  • Latest release: Jun 2, 2022
  • Number of updates: 435
  • Update frequency: every 10.0 days
  • Top authors: iworks (100%)

Code review

54 tests

User reviews

126 reviews

Install metrics

2,000+ active /181,595 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▲2.25ms] Passed 4 tests

Analyzing server-side resources used by upPrev
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6138.98 ▼3.44
Dashboard /wp-admin3.97 ▲0.6748.09 ▲6.39
Posts /wp-admin/edit.php4.02 ▲0.6649.47 ▲4.46
Add New Post /wp-admin/post-new.php6.48 ▲0.6095.52 ▲2.15
Media Library /wp-admin/upload.php3.83 ▲0.6040.77 ▲5.82
upPrev /wp-admin/themes.php?page=iworks_upprev_index4.0055.22

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 60 new files
Database: no new tables, 46 new options
New WordPress options
can_compress_scripts
iworks_upprev_number_of_posts
iworks_upprev_color_border
iworks_upprev_ga_status
iworks_upprev_layout
iworks_upprev_excerpt_length
db_upgraded
iworks_upprev_ignore_sticky_posts
iworks_upprev_ga_track_clicks
theysaidso_admin_options
...

Browser metrics Passed 4 tests

upPrev: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.24 ▼1.431.77 ▲0.1141.88 ▼2.62
Dashboard /wp-admin2,210 ▲245.86 ▲0.0099.06 ▼6.3039.42 ▼6.08
Posts /wp-admin/edit.php2,093 ▲12.06 ▲0.0439.47 ▼1.6235.29 ▼0.92
Add New Post /wp-admin/post-new.php1,540 ▲1223.30 ▲5.07659.67 ▲10.3152.39 ▼12.81
Media Library /wp-admin/upload.php1,386 ▼24.24 ▲0.0498.69 ▼9.6740.00 ▼7.94
upPrev /wp-admin/themes.php?page=iworks_upprev_index1,8023.2598.3080.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/upprev/includes/iworks/rate/rate.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/upprev/includes/iworks/rate/templates/widgets/donate.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/upprev/includes/iworks/rate/templates/plugins/og.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/upprev/includes/iworks/rate/templates/widgets/support.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/upprev/includes/iworks/rate/templates/thanks.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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
5 plugin tags: box, notification, related, thumbnail, seo

upprev/upprev.php Passed 13 tests

The principal PHP file in "upPrev" v. 4.0.7 is loaded by WordPress automatically on each request
64 characters long description:
Display cool, animated fly-out or fade box with related content.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected5,619 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP113301,6964,002
JavaScript1064185813
CSS10589466
Sass180138
Markdown2680134
SVG21166

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 192)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity177.50
▷ Minimum class complexity35.00
▷ Maximum class complexity387.00
Average method complexity5.84
▷ Minimum method complexity1.00
▷ Maximum method complexity192.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods146
▷ Static methods106.85%
▷ Public methods10370.55%
▷ Protected methods53.42%
▷ Private methods3826.03%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants218.18%
▷ Class constants981.82%
▷ Public constants9100.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
15 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/iworks/options/assets/styles/images/ui-icons_777620_256x240.png4.51KB4.18KB▼ 7.28%
includes/iworks/options/assets/styles/images/ui-icons_cc0000_256x240.png4.51KB4.18KB▼ 7.28%
assets/images/position-right-top.png3.71KB2.22KB▼ 40.20%
includes/iworks/options/assets/styles/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%
assets/images/position-left-top.png3.71KB2.23KB▼ 39.88%