Skip to content

Commit

Permalink
Deals 6.1.9 release
Browse files Browse the repository at this point in the history
Deals 6.1.9 release:
* Fixed compatibility style routing bug
* Refactored time(UTC)
* HTTP changed to HTTPS
* Refactored CSSFile to CSS_File
* Improved CSS
  • Loading branch information
Marius committed Aug 11, 2019
1 parent 9e39ddf commit b171522
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 78 deletions.
24 changes: 12 additions & 12 deletions Controllers/Front/AssetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public function enqueueMandatoryStyles()
$objStyle->setSitewideStyles();
// Set compatibility styles
$objStyle->setCompatibilityStyles();
$parentThemeCompatibilityCSSFileURL = $objStyle->getParentThemeCompatibilityCSSURL();
$currentThemeCompatibilityCSSFileURL = $objStyle->getCurrentThemeCompatibilityCSSURL();
$sitewideCSSFileURL = $objStyle->getSitewideCSSURL();
$parentThemeCompatibilityCSS_FileURL = $objStyle->getParentThemeCompatibilityCSS_URL();
$currentThemeCompatibilityCSS_FileURL = $objStyle->getCurrentThemeCompatibilityCSS_URL();
$sitewideCSS_FileURL = $objStyle->getSitewideCSS_URL();

if($this->lang->isRTL())
{
Expand All @@ -94,19 +94,19 @@ public function enqueueMandatoryStyles()
}

// Register compatibility styles for further use
if($parentThemeCompatibilityCSSFileURL != '')
if($parentThemeCompatibilityCSS_FileURL != '')
{
wp_register_style($this->conf->getPluginURL_Prefix().'parent-theme-front-compatibility', $parentThemeCompatibilityCSSFileURL);
wp_register_style($this->conf->getPluginURL_Prefix().'parent-theme-front-compatibility', $parentThemeCompatibilityCSS_FileURL);
}
if($currentThemeCompatibilityCSSFileURL != '')
if($currentThemeCompatibilityCSS_FileURL != '')
{
wp_register_style($this->conf->getPluginURL_Prefix().'current-theme-front-compatibility', $currentThemeCompatibilityCSSFileURL);
wp_register_style($this->conf->getPluginURL_Prefix().'current-theme-front-compatibility', $currentThemeCompatibilityCSS_FileURL);
}

// Register plugin sitewide style for further use
if($sitewideCSSFileURL != '')
if($sitewideCSS_FileURL != '')
{
wp_register_style($this->conf->getPluginURL_Prefix().'front-sitewide', $sitewideCSSFileURL);
wp_register_style($this->conf->getPluginURL_Prefix().'front-sitewide', $sitewideCSS_FileURL);
}

// As these styles are mandatory, enqueue them here
Expand Down Expand Up @@ -154,10 +154,10 @@ public function registerStyles()
wp_register_style('slick-theme', $this->conf->getRouting()->get3rdPartyAssetsURL('slick/slick-theme.css'));

// Register plugin local style for further use
$localCSSFileURL = $objStyle->getLocalCSSURL();
if($localCSSFileURL != '')
$localCSS_FileURL = $objStyle->getLocalCSS_URL();
if($localCSS_FileURL != '')
{
wp_register_style($this->conf->getPluginHandlePrefix().'main', $localCSSFileURL);
wp_register_style($this->conf->getPluginHandlePrefix().'main', $localCSS_FileURL);
}
}
}
4 changes: 2 additions & 2 deletions Deals.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Deals
* Plugin URI: https://wordpress.org/plugins/deals/
* Description: It’s a high quality, native and responsive WordPress plugin to create and view slider-based deals
* Version: 6.1.8
* Version: 6.1.9
* Author: KestutisIT
* Author URI: https://profiles.wordpress.org/KestutisIT
* Text Domain: deals
Expand Down Expand Up @@ -43,7 +43,7 @@ final class Deals
const REQUIRED_PHP_VERSION = '5.6.0';
const REQUIRED_WP_VERSION = 4.6;
const OLDEST_COMPATIBLE_PLUGIN_SEMVER = '6.0.0';
const PLUGIN_SEMVER = '6.1.8';
const PLUGIN_SEMVER = '6.1.9';

// Settings
/**
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

2 changes: 1 addition & 1 deletion Models/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function __construct(
// esc_url replaces ' and & chars with ' and & - but because we know that exact path,
// we know it does not contains them, so we don't need to have two versions esc_url and esc_url_raw
// Demo examples (__FILE__ = $this->pluginFolderAndFile):
// 1. plugin_dir_url(__FILE__) => http://nativerental.com/wp-content/plugins/Deals/
// 1. plugin_dir_url(__FILE__) => https://nativerental.com/wp-content/plugins/Deals/
$this->pluginURL = esc_url(plugin_dir_url($this->pluginPathWithFilename));


Expand Down
4 changes: 2 additions & 2 deletions Models/Deal/Deal.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function save(array $params)
$validUploadedImageFileName = '';
if($_FILES['deal_image']['tmp_name'] != '')
{
$uploadedImageFileName = StaticFile::uploadImageFile($_FILES['deal_image'], $this->conf->getGlobalGalleryPathWithoutEndSlash(), "location_");
$uploadedImageFileName = StaticFile::uploadImageFile($_FILES['deal_image'], $this->conf->getGlobalGalleryPathWithoutEndSlash(), "deal_");
StaticFile::makeThumbnail($this->conf->getGlobalGalleryPath(), $uploadedImageFileName, $this->thumbWidth, $this->thumbHeight, "thumb_");
$validUploadedImageFileName = esc_sql(sanitize_file_name($uploadedImageFileName)); // for sql query only
}
Expand Down Expand Up @@ -258,7 +258,7 @@ public function save(array $params)
$validUploadedImageFileName = '';
if($_FILES['deal_image']['tmp_name'] != '')
{
$uploadedImageFileName = StaticFile::uploadImageFile($_FILES['deal_image'], $this->conf->getGlobalGalleryPathWithoutEndSlash(), "location_");
$uploadedImageFileName = StaticFile::uploadImageFile($_FILES['deal_image'], $this->conf->getGlobalGalleryPathWithoutEndSlash(), "deal_");
StaticFile::makeThumbnail($this->conf->getGlobalGalleryPath(), $uploadedImageFileName, $this->thumbWidth, $this->thumbHeight, "thumb_");
$validUploadedImageFileName = esc_sql(sanitize_file_name($uploadedImageFileName)); // for sql query only
}
Expand Down
2 changes: 1 addition & 1 deletion Models/Routing/UI_Routing.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public function getFrontLocalDevCSS_URL($paramRelativeURL_AndFile = '', $paramRe

public function getFrontSitewideCSS_URL($paramRelativeURL_AndFile = '', $paramReturnWithFileName = TRUE)
{
$folderURL = $this->getURL('Assets/Front/CSS/Compatibility/'.$paramRelativeURL_AndFile, FALSE).'Assets/Front/CSS/Compatibility/';
$folderURL = $this->getURL('Assets/Front/CSS/Sitewide/'.$paramRelativeURL_AndFile, FALSE).'Assets/Front/CSS/Sitewide/';

return $folderURL.($paramReturnWithFileName === TRUE ? $paramRelativeURL_AndFile : '');
}
Expand Down
39 changes: 23 additions & 16 deletions Models/Style/Style.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class Style implements StyleInterface
{
private $conf = NULL;
private $lang = NULL;
private $debugMode = 0;
private $debugMode = 0; // 0 - disabled, 1 - regular debug, 2+ - deep debug
private $styleName = "";
private $sitewideStyles = array();
private $compatibilityStyles = array();
Expand Down Expand Up @@ -52,10 +52,12 @@ public function setSitewideStyles()

if($this->debugMode >= 2)
{
echo "<br />CSS FILES:<br />".var_export($cssFiles, TRUE);
echo "<br />COMPATIBILITY STYLES: ".nl2br(print_r($this->compatibilityStyles, TRUE));
echo "<br /><br />GLOBAL STYLES: ".nl2br(print_r($this->sitewideStyles, TRUE));

echo "<br /><br />---------------------------------------------------------------------------------";
echo "<br /><strong>[setSitewideStyles()]</strong> \$cssFolderPath: {$cssFolderPath}</strong>";
echo "<br /><strong>[setSitewideStyles()]</strong> \$cssFolderURL: {$cssFolderURL}</strong>";
echo "<br /><strong>[setSitewideStyles()]</strong> CSS FILES:<br />".var_export($cssFiles, TRUE);
echo "<br /><br /><strong>[setSitewideStyles()]</strong> SITEWIDE STYLES: ".nl2br(print_r($this->sitewideStyles, TRUE));
echo "<br />---------------------------------------------------------------------------------";
}
}

Expand All @@ -79,10 +81,12 @@ public function setCompatibilityStyles()

if($this->debugMode >= 2)
{
echo "<br />CSS FILES:<br />".var_export($cssFiles, TRUE);
echo "<br />COMPATIBILITY STYLES: ".nl2br(print_r($this->compatibilityStyles, TRUE));
echo "<br /><br />GLOBAL STYLES: ".nl2br(print_r($this->sitewideStyles, TRUE));

echo "<br /><br />---------------------------------------------------------------------------------";
echo "<br /><strong>[setCompatibilityStyles()]</strong> \$cssFolderPath: {$cssFolderPath}</strong>";
echo "<br /><strong>[setCompatibilityStyles()]</strong> \$cssFolderURL: {$cssFolderURL}</strong>";
echo "<br /><strong>[setCompatibilityStyles()]</strong> CSS FILES:<br />".var_export($cssFiles, TRUE);
echo "<br /><strong>[setCompatibilityStyles()]</strong> COMPATIBILITY STYLES: ".nl2br(print_r($this->compatibilityStyles, TRUE));
echo "<br />---------------------------------------------------------------------------------";
}
}

Expand All @@ -107,9 +111,12 @@ public function setLocalStyles()

if($this->debugMode >= 2)
{
echo "<br />CSS FILES:<br />".var_export($cssFiles, TRUE);
echo "<br /><br />SYSTEM STYLES: ".nl2br(print_r($this->localStyles, TRUE));

echo "<br /><br />---------------------------------------------------------------------------------";
echo "<br /><strong>[setLocalStyles()]</strong> \$cssFolderPath: {$cssFolderPath}</strong>";
echo "<br /><strong>[setLocalStyles()]</strong> \$cssFolderURL: {$cssFolderURL}</strong>";
echo "<br /><strong>[setLocalStyles()]</strong> CSS FILES:<br />".var_export($cssFiles, TRUE);
echo "<br /><br /><strong>[setLocalStyles()]</strong> LOCAL STYLES: ".nl2br(print_r($this->localStyles, TRUE));
echo "<br />---------------------------------------------------------------------------------";
}
}

Expand All @@ -118,7 +125,7 @@ public function inDebug()
return ($this->debugMode >= 1 ? TRUE : FALSE);
}

public function getParentThemeCompatibilityCSSURL()
public function getParentThemeCompatibilityCSS_URL()
{
// Get parent theme name
$parentThemeName = "";
Expand Down Expand Up @@ -148,7 +155,7 @@ public function getParentThemeCompatibilityCSSURL()
return $compatibilityFileURL;
}

public function getCurrentThemeCompatibilityCSSURL()
public function getCurrentThemeCompatibilityCSS_URL()
{
// Get current theme name
$currentThemeName = "";
Expand Down Expand Up @@ -177,7 +184,7 @@ public function getCurrentThemeCompatibilityCSSURL()
return $compatibilityFileURL;
}

public function getSitewideCSSURL()
public function getSitewideCSS_URL()
{
// Get the stylesheet file and it's path
$selectedFileURL = '';
Expand Down Expand Up @@ -207,7 +214,7 @@ public function getSitewideCSSURL()
return $fileURL;
}

public function getLocalCSSURL()
public function getLocalCSS_URL()
{
// Get the stylesheet file and it's path
$selectedFileURL = '';
Expand Down
8 changes: 4 additions & 4 deletions Models/Style/StyleInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function setLocalStyles();
public function inDebug();

// Getters
public function getParentThemeCompatibilityCSSURL();
public function getCurrentThemeCompatibilityCSSURL();
public function getSitewideCSSURL();
public function getLocalCSSURL();
public function getParentThemeCompatibilityCSS_URL();
public function getCurrentThemeCompatibilityCSS_URL();
public function getSitewideCSS_URL();
public function getLocalCSS_URL();
}
2 changes: 1 addition & 1 deletion Models/Update/Patches61Z.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class Patches61Z extends AbstractDatabase implements StackInterface, Datab
{
const CURRENT_MAJOR = 6; // Positive integer [X]
const CURRENT_MINOR = 1; // Positive integer [Y]
const LATEST_PATCH = 8; // Positive integer [Z]
const LATEST_PATCH = 9; // Positive integer [Z]
const LATEST_RELEASE = ''; // String
const LATEST_BUILD_METADATA = ''; // String
const PLUGIN_PREFIX = "deals_";
Expand Down
6 changes: 3 additions & 3 deletions Models/Validation/StaticValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ public static function getUTC_ISO_DateByTimestamp($paramTimestamp)
return $utcISO_Date;
}

public static function getUTCTimestampFromLocalISODateTime($paramDate, $paramTime)
public static function getUTC_TimestampFromLocalISO_DateTime($paramDate, $paramTime)
{
$UTCTimestamp = 0;
$validISODate = static::getValidISO_Date($paramDate, 'Y-m-d');
Expand All @@ -695,9 +695,9 @@ public static function getUTCTimestampFromLocalISODateTime($paramDate, $paramTim
/*
* Appears that this function is useless in the NS and nowhere used
* While my brains still think that I want to add timezone offset, appears that correct way is to subtract it
* via getUTCTimestampFromLocalISODateTime($paramDate, $paramTime)
* via getUTC_TimestampFromLocalISO_DateTime($paramDate, $paramTime)
*/
public static function getLocalTimestampFromUTC_ISODateTime($paramDate, $paramTime)
public static function getLocalTimestampFromUTC_ISO_DateTime($paramDate, $paramTime)
{
$localTimestamp = 0;
$validISODate = static::getValidISO_Date($paramDate, 'Y-m-d');
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ to your website's deal page and show only desired deal by following this URL str

# Changelog

= 6.1.9 =
* Fixed compatibility style routing bug
* Refactored time(UTC)
* HTTP changed to HTTPS
* Refactored CSSFile to CSS_File
* Improved CSS

= 6.1.8 =
* Fixed minor bug with demoDealImageURL.
* Gallery folder routing improved.
Expand Down
5 changes: 5 additions & 0 deletions UI/Assets/Front/CSS/Compatibility/AvadaCar-child.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Additional plugin styles for compatibility with Avada
* Theme Name: Avada Car Child
* License: Licensed under the AGPL license.
*/
15 changes: 13 additions & 2 deletions UI/Assets/Front/CSS/Compatibility/INFORMATION.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
What is compatibility styles?
Style in this folder will get loaded only if the current active theme folder name
will match the style file name (excl. the file extension).
Compatibility style is a stylesheet that only gets loaded if it's file's name and header's
theme name matches the current active theme on your site, i.e.:

current active theme's folder: AvadaCar-child
current active theme's stylesheet's theme name: Avada Car Child

so the compatible stylesheet should be named: AvadaCar-child.css
and it's theme name in the header should be: Avada Car Child

This style is needed for example, when you are not satisfied
with the plugin's current style and you want to make changes. This is a
good way to keep things organized and your custom style won't get lost
after an update. So basically this is a child-theme for your plugin
20 changes: 9 additions & 11 deletions UI/Assets/Front/CSS/Local/Shared/LayoutPartial.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
width: 100%;
}
.responsive-deals-slider .deals-slide {
position: relative;
justify-content: center;
width:100%;
flex-shrink: 0;

}
.responsive-deals-slider .slides-wrapper {
justify-content: center;
}
.responsive-deals-slider .slider-image-container {
position: relative;
Expand Down Expand Up @@ -181,10 +181,13 @@
.slick-dots li button::before {
font-size: 20px;
}
@media all and (max-width: 1024px) {
.responsive-deals-slider .slider-deals {
@media all and (max-width: 1026px) {
.responsive-deals-slider .slides-wrapper .single-deal * {
font-size: 30px;
}
.responsive-deals-slider .slides-wrapper {
/*width: 90%;*/
}
.responsive-deals-slider .single-deal {
width: 265px;
}
Expand All @@ -195,13 +198,8 @@
right: 5px;
}
}
@media all and (max-width: 970px) {
.responsive-deals-slider .slider-deals {
font-size: 30px;
}
}
@media all and (max-width: 867px) {
.responsive-deals-slider .deals-slide {
.responsive-deals-slider .deals-slide .slides-wrapper{
flex-direction: column;
align-items: center;
}
Expand Down
4 changes: 3 additions & 1 deletion UI/Templates/Front/DealsSlider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<div class="responsive-deals-slider">
<?php foreach($dealSlides as $slideId => $deals): ?>
<div class="slide-container">
<div class="deals-slide flex-container deals-slide-<?=esc_attr($slideId);?>">
<div class="deals-slide deals-slide-<?=esc_attr($slideId);?>">
<div class="slides-wrapper flex-container">

<div class="slider-image-container slide<?=esc_attr($slideId);?>-deal-images">
<?php foreach($deals as $deal): ?>
Expand Down Expand Up @@ -78,6 +79,7 @@
<?php endforeach; ?>
</div>

</div>
</div>
</div>
<?php endforeach; ?>
Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Finally - the code is poetry - __the better is the web, the happier is the world

- - - -
== Live Demo ==
[Deals (Live Demo)](http://nativerental.com/cars/ "Deals (Live Demo)")
[Deals (Live Demo)](https://nativerental.com/cars/ "Deals (Live Demo)")

== GitHub Repository (for those, who want to contribute via "Pull Requests") ==
[https://github.com/SolidMVC/Deals](https://github.com/SolidMVC/Deals "Deals @GitHub")
Expand Down Expand Up @@ -106,6 +106,13 @@ to your website's deal page and show only desired deal by following this URL str

== Changelog ==

= 6.1.9 =
* Fixed compatibility style routing bug
* Refactored time(UTC)
* HTTP changed to HTTPS
* Refactored CSSFile to CSS_File
* Improved CSS

= 6.1.8 =
* Fixed minor bug with demoDealImageURL.
* Gallery folder routing improved.
Expand Down

0 comments on commit b171522

Please sign in to comment.