84% lunar-sell-photos-online

Code Review | Lunar - Sell photos online

WordPress plugin Lunar - Sell photos online scored84%from 54 tests.

About plugin

  • Plugin page: lunar-sell-photos...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.3
  • WordPress version: 6.3.1
  • First release: Nov 6, 2014
  • Latest release: Aug 12, 2015
  • Number of updates: 12
  • Update frequency: every 23.4 days
  • Top authors: sakurapixel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /3,420 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.38ms] Passed 4 tests

This is a short check of server-side resources used by Lunar - Sell photos online
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0423.89 ▼16.86
Dashboard /wp-admin3.35 ▲0.0551.87 ▼0.46
Posts /wp-admin/edit.php3.41 ▲0.0554.53 ▲6.02
Add New Post /wp-admin/post-new.php5.93 ▲0.0596.43 ▲1.79
Media Library /wp-admin/upload.php3.28 ▲0.0547.28 ▲13.70
Lunar /wp-admin/edit.php?post_type=ln_grid3.3542.43
Options /wp-admin/edit.php?post_type=ln_grid&page=ct_portfolio_sett3.2839.92
New Album /wp-admin/post-new.php?post_type=ln_grid3.4050.34

Server storage [IO: ▲0.34MB] [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: 64 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
ct_is_rewrite
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Lunar - Sell photos online: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.61 ▼0.801.80 ▼0.0641.54 ▼2.93
Dashboard /wp-admin2,221 ▲364.89 ▲0.00101.09 ▼16.7285.53 ▲41.03
Posts /wp-admin/edit.php2,122 ▲332.14 ▲0.1337.37 ▼0.5931.28 ▼3.83
Add New Post /wp-admin/post-new.php1,694 ▲17522.41 ▼0.84737.35 ▲74.2660.93 ▲1.00
Media Library /wp-admin/upload.php1,409 ▲214.20 ▼0.04108.60 ▼2.6152.24 ▲8.53
Lunar /wp-admin/edit.php?post_type=ln_grid1,3063.8355.2994.01
Options /wp-admin/edit.php?post_type=ln_grid&page=ct_portfolio_sett1,1843.7447.3492.28
New Album /wp-admin/post-new.php?post_type=ln_grid2,2187.71163.31117.39

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
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • ct_is_rewrite
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'LN_CLASS_PATH/com/sakuraplugins/php/libs/resize_helper.php' (include_path='.:/usr/share/php') in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/post-options.php on line 2
    • > PHP Warning
      Use of undefined constant LN_CLASS_PATH - assumed 'LN_CLASS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/plugin_core.php on line 3
    • > PHP Warning
      require_once(LN_CLASS_PATH/com/sakuraplugins/php/customposts/GenericPostType.php): failed to open stream: No such file or directory in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/customposts/SkCPT.php on line 2
    • > PHP Warning
      require_once(LN_CLASS_PATH/com/sakuraplugins/php/libs/resize_helper.php): failed to open stream: No such file or directory in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/post-options.php on line 2
    • > PHP Warning
      Use of undefined constant LN_CLASS_PATH - assumed 'LN_CLASS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/woo-post-options.php on line 2
    • > PHP Warning
      require_once(LN_CLASS_PATHcom/sakuraplugins/php/customposts/SkCPT.php): failed to open stream: No such file or directory in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/plugin_core.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/admin_pages/banner.php:2
    • > PHP Warning
      Use of undefined constant LN_CLASS_PATH - assumed 'LN_CLASS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/customposts/SkCPT.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'LN_CLASS_PATH/com/sakuraplugins/php/customposts/GenericPostType.php' (include_path='.:/usr/share/php') in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/customposts/SkCPT.php on line 2
    • > PHP Warning
      require_once(LN_CLASS_PATH/com/sakuraplugins/php/libs/resize_helper.php): failed to open stream: No such file or directory in wp-content/plugins/lunar-sell-photos-online/com/sakuraplugins/php/woo-post-options.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: exif, woocommerce, exif data, sell photos, gallery...

lunar-sell-photos-online/lunar-woo.php 92% from 13 tests

Analyzing the main PHP file in "Lunar - Sell photos online" version 1.3.0
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("lunar-sell-photos-online.php" instead of "lunar-woo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin4,020 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP173957561,715
JavaScript3128971,275
CSS348361,030

PHP code Passed 2 tests

A short 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.45
Average class complexity18.59
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods118
▷ Static methods1916.10%
▷ Public methods10387.29%
▷ Protected methods32.54%
▷ Private methods1210.17%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants1150.00%
▷ Class constants1150.00%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
38 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
com/sakuraplugins/images/icons/camera-lens.png1.54KB0.80KB▼ 48.20%
com/sakuraplugins/images/icons/blue-folder-open-film.png1.52KB0.88KB▼ 41.96%
com/sakuraplugins/images/icons/camera-plus.png1.51KB0.72KB▼ 52.46%
com/sakuraplugins/css/images/edit.png3.34KB0.58KB▼ 82.49%
com/sakuraplugins/images/ui/align_right.PNG2.87KB0.22KB▼ 92.21%