Changeset 3108589
- Timestamp:
- 06/27/2024 11:07:06 AM (4 weeks ago)
- Location:
- depicter/trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
depicter/trunk/app/hooks.php
r3104895 r3108589 12 12 } 13 13 14 // phpcs:ignore15 // add_action( 'some_action', 'some_function' );16 14 function depicter_add_thumbnail_size() { 17 15 add_image_size( 'depicter-thumbnail', 200, 9999, false ); … … 162 160 163 161 function depicter_check_activation() { 162 164 163 if ( isset( $_GET['depicter_upgraded'] ) ) { 165 164 if ( \Depicter::client()->validateActivation() ) { … … 171 170 } 172 171 } 173 if ( isset( $_GET['depicter_flush_tokens'] ) ) { 172 173 if ( isset( $_GET['depicter_flush_tokens'] ) && user_can( wp_get_current_user(), 'manage_options') ) { 174 174 \Depicter::client()->getRefreshToken( true ); 175 175 \Depicter::client()->getAccessToken( true ); … … 205 205 add_action( 'admin_notices', 'depicter_renew_subscription_notice'); 206 206 function depicter_renew_subscription_notice() { 207 $expiresAt = \Depicter::options()->get('subscription_expires_at' , ''); 208 if ( empty( $expiresAt ) || strtotime( $expiresAt ) > time() ) { 207 if ( ! \Depicter::auth()->isSubscriptionExpired() ) { 209 208 return; 210 209 } -
depicter/trunk/app/src/Database/Repository/MetaRepository.php
r3103357 r3108589 23 23 */ 24 24 public function meta(): Meta{ 25 return new Meta();25 return (); 26 26 } 27 27 -
depicter/trunk/app/src/Document/Manager.php
r3103357 r3108589 141 141 // set document entity properties 142 142 $documentModel->setDocumentId( $documentId ); 143 $documentModel->set UnpublishedNotice( $documentId );143 $documentModel->setNotice( $documentId ); 144 144 $documentModel->setEntityProperty( 'status', $this->getStatus( $documentId ) ); 145 145 -
depicter/trunk/app/src/Document/Models/Document.php
r3103357 r3108589 218 218 $style = Html::style([],' 219 219 .depicter-admin-notices { 220 position:absolute; 221 left: 20px; 222 top: 20px; 223 display: flex; 224 gap:8px; 220 position:absolute; 221 left: 20px; 222 top: 20px; 223 display: flex; 224 gap:8px; 225 225 flex-direction: column; 226 226 z-index: 50; -
depicter/trunk/app/src/Document/Models/Traits/DocumentAdminNoticeTrait.php
r3103357 r3108589 3 3 4 4 use Averta\Core\Utility\JSON; 5 5 6 6 7 trait DocumentAdminNoticeTrait { … … 11 12 * @var int|null 12 13 */ 13 protected $show UnpublishedNotice = false;14 protected $showNotice = false; 14 15 15 16 /** … … 18 19 * @return int|null 19 20 */ 20 public function show UnpublishedNotice() {21 return $this->show UnpublishedNotice;21 public function showNotice() { 22 return $this->showNotice; 22 23 } 23 24 … … 25 26 * Enables or disables unpublished notice of document 26 27 * 27 * @param int $show UnpublishedNotice28 * @param int $showNotice 28 29 * 29 30 * @return mixed 30 31 */ 31 public function set UnpublishedNotice( $showUnpublishedNotice = false ) {32 $this->show UnpublishedNotice = $showUnpublishedNotice;32 public function setNotice = false ) { 33 $this->showNotice; 33 34 return $this; 34 35 } … … 40 41 */ 41 42 public function getUnpublishedChangesNotice() { 42 if( ! $this->show UnpublishedNotice() || ! $this->getDocumentID() ) {43 if( ! $this->showNotice() || ! $this->getDocumentID() ) { 43 44 return ''; 44 45 } … … 78 79 */ 79 80 public function getExpiredSubscriptionNotice() { 80 if( ! $this-> getDocumentID() ) {81 if( ! $this->getDocumentID() ) { 81 82 return ''; 82 83 } … … 86 87 } 87 88 88 $documentType = \Depicter::documentRepository()->findOne( $this->getDocumentID() )->getProperty('type'); 89 if ( in_array( $documentType, ['popup', 'banner-bar'] ) ) { 89 try{ 90 // skip admin notice display for popup and notification bars 91 if ( in_array( \Depicter::documentRepository()->findOne( $this->getDocumentID() )->getProperty('type'), ['popup', 'banner-bar', 'notification-bar'] ) ) { 92 return ''; 93 } 94 }catch( \Exception $e ){ 90 95 return ''; 91 96 } -
depicter/trunk/app/src/Front/Preview.php
r3013596 r3108589 104 104 try{ 105 105 $documentModel = \Depicter::document()->getModel( $documentId, $where ); 106 $documentModel->set UnpublishedNotice( false );106 $documentModel->setNotice( false ); 107 107 $viewArgs = $this->prepareToRender( $documentModel, $viewArgs ); 108 108 … … 184 184 */ 185 185 protected function view( $args ){ 186 // JetPack compatibility issue 186 // JetPack compatibility issue 187 187 if ( class_exists( 'Filter_Embedded_HTML_Objects' ) ) { 188 188 remove_filter( 'pre_kses', array( 'Filter_Embedded_HTML_Objects', 'filter' ), 11 ); … … 191 191 $view = \Depicter::view('canvas.php')->with( 'view_args', $args )->toString(); 192 192 193 // JetPack compatibility issue 193 // JetPack compatibility issue 194 194 if ( class_exists( 'Filter_Embedded_HTML_Objects' ) ) { 195 195 add_filter( 'pre_kses', array( 'Filter_Embedded_HTML_Objects', 'filter' ), 11 ); -
depicter/trunk/app/src/Front/Render.php
r3043965 r3108589 36 36 'echo' => true, 37 37 'status' => 'publish', 38 'show UnpublishedNotice' => $isPrivilegedUser38 'showNotice' => $isPrivilegedUser 39 39 ]); 40 40 … … 91 91 } 92 92 93 if( ! $args['show UnpublishedNotice'] && ! \Depicter::document()->repository()->isPublishedBefore( $documentID ) ) {93 if( ! $args['showNotice'] && ! \Depicter::document()->repository()->isPublishedBefore( $documentID ) ) { 94 94 throw new DocumentNotPublished( __( 'Slider is not published yet and saved as "draft"', 'depicter' ), 0, $where ); 95 95 } … … 97 97 if( $documentModel = \Depicter::document()->getModel( $documentID, $where ) ){ 98 98 99 $documentModel->set UnpublishedNotice( $args['showUnpublishedNotice'] );99 $documentModel->setNotice'] ); 100 100 101 101 $output .= $documentModel->prepare()->render(); … … 206 206 $cacheFor = !empty( $args['isPrivilegedUser'] ) ? 'admin_' : ''; 207 207 // Include admin notice in document markup or not 208 $isAdminNoticeEnabled = !empty( $args['show UnpublishedNotice'] ) ? 'notice_' : '';208 $isAdminNoticeEnabled = !empty( $args['showNotice'] ) ? 'notice_' : ''; 209 209 // The last modified date of main document 210 210 $documentModifiedTime = strtotime( \Depicter::documentRepository()->getFieldValue( $documentID, 'modified_at') ); -
depicter/trunk/app/src/Services/AuthenticationService.php
r3103357 r3108589 64 64 $subExpiresAtTimestamp = strtotime($subExpiresAt." UTC"); 65 65 $afterExpirationInSeconds = time() - $subExpiresAtTimestamp; 66 66 67 67 if( $afterExpirationInSeconds > 5 * DAY_IN_SECONDS ) { 68 68 return 'expired'; … … 72 72 } 73 73 74 return $subExpiresAt;74 return ; 75 75 } 76 76 -
depicter/trunk/app/src/WordPress/FileUploaderService.php
r2735350 r3108589 3 3 4 4 use Averta\WordPress\File\UploadsDirectory; 5 5 6 use GuzzleHttp\Psr7\UploadedFile; 6 7 … … 26 27 } 27 28 28 if ( !in_array( $file->getClientMediaType(), $allowedMimeTypes ) ) { 29 $clientFileName = Sanitize::fileName( $file->getClientFilename() ); 30 // make sure that file mime type is allowed and the extension is not .php 31 if ( !in_array( $file->getClientMediaType(), $allowedMimeTypes ) || substr( $clientFileName, -4 ) === '.php' ) { 29 32 $results[ $file->getClientFilename() ] = [ 30 33 'attachment' => 0, … … 35 38 continue; 36 39 } 37 38 $filename = $wp_upload_dir->getPath() . "/" . $ file->getClientFilename();40 41 $filename = $wp_upload_dir->getPath() . "/" . $; 39 42 $file->moveTo( $filename ); 40 43 $attachment = array( -
depicter/trunk/depicter.php
r3104895 r3108589 4 4 * Plugin URI: https://depicter.com 5 5 * Description: Build stunning sliders, popups, carousels, video sliders, post sliders, and WooCommerce sliders fast and easy. 6 * Version: 3.1. 16 * Version: 3.1. 7 7 * Requires at least: 5.3 8 8 * Requires PHP: 7.4.0 … … 18 18 */ 19 19 20 const DEPICTER_VERSION = '3.1. 1';20 const DEPICTER_VERSION = '3.1.'; 21 21 22 22 if ( ! defined( 'ABSPATH' ) ) { -
depicter/trunk/readme.txt
r3104895 r3108589 3 3 Tags: slider, carousel slider, popup, post slider, slideshow 4 4 Requires at least: 5.3.0 5 Tested up to: WordPress 6.5. 45 Tested up to: WordPress 6.5. 6 6 Requires PHP: 7.4.0 7 Stable tag: 3.1. 17 Stable tag: 3.1. 8 8 License: GPL-2.0-only 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 70 70 == Changelog == 71 71 72 73 74 75 76 72 77 ###3.1.1 73 78 - *Released: 2024-06-20*
Note: See TracChangeset
for help on using the changeset viewer.