77% wp-time-capsule

Code Review | Backup and Staging by WP Time Capsule

WordPress plugin Backup and Staging by WP Time Capsule scored77%from 54 tests.

About plugin

  • Plugin page: wp-time-capsule
  • Plugin version: 1.22.18
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.14-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 11, 2014
  • Latest release: Oct 3, 2023
  • Number of updates: 437
  • Update frequency: every 7.4 days
  • Top authors: WPTimeCapsule (100%)

Code review

54 tests

User reviews

117 reviews

Install metrics

20,000+ active /1,265,605 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.56MB] [CPU: ▲4.07ms] Passed 4 tests

A check of server-side resources used by Backup and Staging by WP Time Capsule
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2437.76 ▼4.88
Dashboard /wp-admin4.02 ▲0.6755.68 ▼4.55
Posts /wp-admin/edit.php4.07 ▲0.7160.52 ▲11.58
Add New Post /wp-admin/post-new.php6.55 ▲0.67132.65 ▲25.05
Media Library /wp-admin/upload.php3.88 ▲0.6550.35 ▲14.11
Settings /wp-admin/admin.php?page=wp-time-capsule-settings4.1063.23
Backups /wp-admin/admin.php?page=wp-time-capsule-monitor3.9550.26
Initial Setup /wp-admin/admin.php?page=wp-time-capsule3.9551.50
Activity Log /wp-admin/admin.php?page=wp-time-capsule-activity3.8841.30

Server storage [IO: ▲30.12MB] [DB: ▲0.02MB] 33% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Illegal file modification found: 1 file (0.98KB) outside of "wp-content/plugins/wp-time-capsule/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/0-mu-wp-time-capsule.php
  • The filesystem usage should be lower than 25MB (currently using 30.12MB)
Filesystem: 2,225 new files
Database: 8 new tables, 7 new options
New tables
wp_wptc_inc_exc_contents
wp_wptc_activity_log
wp_wptc_processed_iterator
wp_wptc_processed_files
wp_wptc_backups
wp_wptc_options
wp_wptc_current_process
wp_wptc_processed_restored_files
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
is_wptc_activation_redirected

Browser metrics Passed 4 tests

Backup and Staging by WP Time Capsule: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲10413.69 ▼0.662.02 ▼0.3442.64 ▲0.83
Dashboard /wp-admin2,256 ▲715.02 ▼0.85121.10 ▲16.1844.38 ▲1.00
Posts /wp-admin/edit.php2,133 ▲442.12 ▲0.1241.89 ▲6.6132.96 ▼2.32
Add New Post /wp-admin/post-new.php1,549 ▲3023.10 ▼0.31687.52 ▼4.0168.01 ▲10.91
Media Library /wp-admin/upload.php1,429 ▲444.36 ▲0.15105.64 ▼6.5342.18 ▼7.31
Settings /wp-admin/admin.php?page=wp-time-capsule-settings9642.8749.2344.37
Backups /wp-admin/admin.php?page=wp-time-capsule-monitor9642.9844.2231.10
Initial Setup /wp-admin/admin.php?page=wp-time-capsule9632.9940.0328.17
Activity Log /wp-admin/admin.php?page=wp-time-capsule-activity9842.0032.6927.81

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-time-capsule/S3/mtdowlingwptc/jmespath.php/bin/jp.php
    • > /wp-content/plugins/wp-time-capsule/Pro/Staging/Views/wptc-staging-options.php
    • > /wp-content/plugins/wp-time-capsule/wp-tcapsule-bridge/index.php
    • > /wp-content/plugins/wp-time-capsule/Pro/Staging/bridge/bridge.php
    • > /wp-content/plugins/wp-time-capsule/wp-tcapsule-bridge/wptc-copy.php
    • > /wp-content/plugins/wp-time-capsule/wp-tcapsule-bridge/wptc-ajax.php
  • 734× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Plugin\\Backoff\\AbstractBackoffStrategy' not found in wp-content/plugins/wp-time-capsule/S3_BWC/aws/aws-sdk-php/src/AwsWPTC/S3/IncompleteMultipartUploadChecker.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Common\\Collection' not found in wp-content/plugins/wp-time-capsule/S3_BWC/guzzle/guzzle/src/Guzzle/Service/Resource/Model.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'AwsWPTC\\S3\\Exception\\S3Exception' not found in wp-content/plugins/wp-time-capsule/S3_BWC/aws/aws-sdk-php/src/AwsWPTC/S3/Exception/NotImplementedException.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'AwsWPTC\\Crypto\\MetadataStrategyInterface' not found in wp-content/plugins/wp-time-capsule/S3/awswptc/aws-sdk-php/src/S3/Crypto/InstructionFileMetadataStrategy.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Http\\Exception\\BadResponseException' not found in wp-content/plugins/wp-time-capsule/S3_BWC/guzzle/guzzle/src/Guzzle/Http/Exception/TooManyRedirectsException.php:5
    • > PHP Fatal error
      Uncaught PharException: internal corruption of phar "wp-content/plugins/wp-time-capsule/S3_BWC/guzzle/guzzle/phar-stub.php" (truncated manifest at stub end) in wp-content/plugins/wp-time-capsule/S3_BWC/guzzle/guzzle/phar-stub.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'AwsWPTC\\S3\\Exception\\S3Exception' not found in wp-content/plugins/wp-time-capsule/S3_BWC/aws/aws-sdk-php/src/AwsWPTC/S3/Exception/InvalidAddressingHeaderException.php:22
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-time-capsule/Classes/ActivityLog.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'AwsWPTC\\S3\\Model\\MultipartUpload\\AbstractTransfer' not found in wp-content/plugins/wp-time-capsule/S3_BWC/aws/aws-sdk-php/src/AwsWPTC/S3/Model/MultipartUpload/ParallelTransfer.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'AwsWPTC\\S3\\Exception\\S3Exception' not found in wp-content/plugins/wp-time-capsule/S3_BWC/aws/aws-sdk-php/src/AwsWPTC/S3/Exception/NoSuchBucketPolicyException.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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:
  • Tags: Please reduce the number of tags, currently 69 tag instead of maximum 10
You can look at the official readme.txt

wp-time-capsule/wp-time-capsule.php 92% from 13 tests

The main PHP file in "Backup and Staging by WP Time Capsule" ver. 1.22.18 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 202 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin208,751 lines of code in 2,148 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,92330,07562,520156,572
JavaScript775,6654,60030,671
CSS175964516,180
SVG21195,650
Markdown241,49804,942
JSON401402,229
reStructuredText311,2711,8231,883
XML42911212
make2285133
YAML5280101
HTML216095
Python1222349
Ant110134

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 149)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.19
▷ Minimum class complexity1.00
▷ Maximum class complexity700.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity149.00
Code structure
Namespaces168
Interfaces114
Traits18
Classes1,258
▷ Abstract classes503.97%
▷ Concrete classes1,20896.03%
▷ Final classes262.15%
Methods10,255
▷ Static methods6316.15%
▷ Public methods8,26880.62%
▷ Protected methods5835.69%
▷ Private methods1,40413.69%
Functions905
▷ Named functions53559.12%
▷ Anonymous functions37040.88%
Constants1,093
▷ Global constants50746.39%
▷ Class constants58653.61%
▷ Public constants586100.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
27 PNG files occupy 0.30MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fullcalendar-2.0.2/lib/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png0.38KB0.17KB▼ 54.43%
fullcalendar-2.0.2/lib/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png0.35KB0.20KB▼ 44.60%
fullcalendar-2.0.2/lib/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png0.43KB0.21KB▼ 51.94%
fullcalendar-2.0.2/lib/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png0.29KB0.17KB▼ 42.00%
images/icon-16x16.png0.65KB0.54KB▼ 17.94%