84% offline-content

Code Review | Offline Content

WordPress plugin Offline Content scored84%from 54 tests.

About plugin

  • Plugin page: offline-content
  • Plugin version: 0.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.5
  • WordPress version: 6.3.1
  • First release: Feb 10, 2016
  • Latest release: Apr 16, 2016
  • Number of updates: 17
  • Update frequency: every 3.9 days
  • Top authors: delapuente (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /5,738 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
Installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼9.03ms] Passed 4 tests

Server-side resources used by Offline Content
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2238.93 ▼3.52
Dashboard /wp-admin3.54 ▲0.1948.15 ▼15.02
Posts /wp-admin/edit.php3.59 ▲0.2351.70 ▲5.37
Add New Post /wp-admin/post-new.php6.05 ▲0.1785.58 ▼22.43
Media Library /wp-admin/upload.php3.40 ▲0.1737.76 ▲4.84
Offline Content /wp-admin/options-general.php?page=offline-options3.3633.95

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 11 new options
New WordPress options
offline_precache
can_compress_scripts
offline_cache_name
widget_recent-posts
wpswmanager_registrations
theysaidso_admin_options
db_upgraded
offline_debug_sw
offline_network_timeout
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Offline Content
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.33 ▼0.971.83 ▲0.0239.05 ▼3.88
Dashboard /wp-admin2,207 ▲195.79 ▲0.9197.29 ▼5.4639.57 ▼1.11
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0938.12 ▼2.2634.00 ▼3.23
Add New Post /wp-admin/post-new.php1,517 ▼1117.65 ▼0.64679.61 ▲76.6060.05 ▲10.86
Media Library /wp-admin/upload.php1,395 ▲44.22 ▲0.0294.85 ▼7.0141.93 ▼0.89
Offline Content /wp-admin/options-general.php?page=offline-options8292.0422.9727.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • wpswmanager_registrations

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
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/offline-content/class-wp-offline-content-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/offline-content/class-wp-offline-content-plugin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/offline-content/lib/pages/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/offline-content/wp-offline-content.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: serivce, workers, precache, offline, read later...

offline-content/wp-offline-content.php 92% from 13 tests

"Offline Content" version 0.6.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("offline-content.php" instead of "wp-offline-content.php")

Code Analysis Passed 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 detected1,352 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP17197249877
JavaScript5487261
JSON300114
Markdown2420100

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity9.80
▷ Minimum class complexity2.00
▷ Maximum class complexity39.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods91
▷ Static methods1213.19%
▷ Public methods7178.02%
▷ Protected methods00.00%
▷ Private methods2021.98%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected