HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/cwd/wp-content/plugins/shortpixel-image-optimiser/class/external/themes/total-theme.php
<?php
namespace ShortPixel\External\Themes;

if ( ! defined( 'ABSPATH' ) ) {
 exit; // Exit if accessed directly.
}

use ShortPixel\ShortPixelLogger\ShortPixelLogger as Log;

class TotalTheme
{

  public function __construct()
  {
//    do_action( 'totaltheme/resize-image/after_save_image', $attachment, $intermediate_size );
    add_action( 'totaltheme/resize-image/after_save_image', array($this, 'resizeImage'), 10, 2);
  }

  public function resizeImage($attachment_id, $size)
  {
    $image = \wpSPIO()->filesystem()->getMediaImage($attachment_id);

    if (! is_object($image))
    {
      return;
    }

    $changes = false;
    $thumbObj = $image->getThumbnail($size);
    if (is_object($thumbObj))
    {
      $thumbObj->onDelete(true);
      $changes = true;
    }
    else {
    }

    if ( true === $changes)
    {
      $image->saveMeta();
    }

}

} // class

$t = new TotalTheme();