Plugin Directory

Changeset 1111122


Ignore:
Timestamp:
03/12/2015 02:11:23 PM (11 years ago)
Author:
expresscurate
Message:

new version v2.0.8 with changes:

  • The problem with temporary files flooding is fixed.
  • Miscellaneous bug fixes and improvements.
Location:
expresscurate/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • expresscurate/trunk/ExpressCurate.php

    r1109426 r1111122  
    55  Plugin URI: http://www.expresscurate.com/products
    66  Description: ExpressCurate plugin is a content curation tool for WordPress. It enables you to create and publish high quality content within minutes.
    7   Version: 2.0.7
     7  Version: 2.0.8
    88  Author: ExpressCurate
    99  Author URI: http://www.expresscurate.com
     
    5656      $cronManager->deactivate_events();
    5757  }
    58 
    5958}
    6059
  • expresscurate/trunk/ExpressCurate_Actions.php

    r1106118 r1111122  
    191191        add_action('update_option_permalink_structure', array(&$this, 'permalink_changes'), 10, 2);
    192192        if ($_REQUEST['page'] == 'expresscurate_settings') {
    193             $cronManager = new ExpressCurate_CronManager();
    194             $cronManager->schedule_events();
     193            $this->cronManager->schedule_events();
    195194
    196195            // Generate sitemap
     
    16391638        $warnings = array();
    16401639        $extWarnings = array();
    1641         $cronManager = new ExpressCurate_CronManager();
    16421640        $homeUrl = get_site_url();
    16431641
  • expresscurate/trunk/ExpressCurate_CronManager.php

    r1106118 r1111122  
    1313    public  $websiteUrlCallCronjob = null;
    1414
    15     private $tmpForCron = null;
    16 
    1715    public function __construct() {
    18         $temp_file =  ExpressCurate_Util::tmpname('.tmp', 'cron');
    19 
    20         $this->tmpForCron = $temp_file;
    21 
    2216        $this->websiteUrlCallCronjob ='0 * * * *  wget  '.get_site_url().' > /dev/null 2>&1';
    2317    }
     
    4640                $output = implode(PHP_EOL, $output);
    4741                $output = $output . PHP_EOL . $this->websiteUrlCallCronjob . PHP_EOL;
    48                 file_put_contents($this->tmpForCron, $output);
    49                 ExpressCurate_Util::exec('crontab ' . $this->tmpForCron, $output);
    50                 unlink($this->tmpForCron);
     42               
     43                $tempFile =  ExpressCurate_Util::tmpname('cron');
     44                file_put_contents($tempFile, $output);
     45                ExpressCurate_Util::exec('crontab ' . $tempFile, $output);
     46                unlink($tempFile);
    5147            }
    5248        }
     
    8076        wp_clear_scheduled_hook('expresscurate_sitemap_push');
    8177
    82         if($this->check_if_exist($this->websiteUrlCallCronjob)){
    83             ExpressCurate_Util::exec('crontab -l' ,$output);
    84             $output = implode(PHP_EOL,$output);
    85             $newCron = str_replace($this->websiteUrlCallCronjob,"",$output);
    86             file_put_contents($this->tmpForCron, $newCron.PHP_EOL);
    87             ExpressCurate_Util::exec('crontab '.$this->tmpForCron);
    88             unlink($this->tmpForCron);
     78        if($this->check_if_exist($this->websiteUrlCallCronjob)) {
     79            ExpressCurate_Util::exec('crontab -l', $output);
     80            $output = implode(PHP_EOL, $output);
     81            $output = str_replace($this->websiteUrlCallCronjob, "", $output) . PHP_EOL;
     82           
     83            $tempFile =  ExpressCurate_Util::tmpname('cron');
     84            file_put_contents($tempFile, $output);
     85            ExpressCurate_Util::exec('crontab ' . $tempFile);
     86            unlink($tempFile);
    8987        }
    9088    }
     
    9290
    9391    public function set_permission_status() {
    94 //        $status = $_REQUEST['status'];
    95 //        update_option('expresscurate_exec_function_permission_status', $status);
    96 
    9792        $status = $_REQUEST['status'] === 'seen' ? 'ignore' : 'manual';
    9893        update_option('expresscurate_cronjob_status', $status);
  • expresscurate/trunk/ExpressCurate_FeedManager.php

    r1109426 r1111122  
    459459                $html_parser = new ExpressCurate_HtmlParser($link);
    460460                $keywords = $html_parser->analyzeKeywords();
    461 
     461                $media = $html_parser->isMediaExists();
    462462                $publishDate = isset($story['publishedDate']) ? $story['publishedDate'] : $story['date'];
    463463                $expressCurateDate = new ExpressCurate_Date();
     
    472472                    'curated' => 0,
    473473                    'keywords' => $keywords,
     474                    'media' => $media
    474475                );
    475476
  • expresscurate/trunk/ExpressCurate_HtmlParser.php

    r1109426 r1111122  
    129129    /*$this->html = preg_replace('/<noscript[^>]*>[\S\s]*?' .
    130130            '<\/noscript>/msi', '', $this->html);*/
    131     $this->html = preg_replace('/<noscript[^>]*>[\s]*?' .
    132             '<\/noscript>/msi', '', $this->html);
     131    $this->html = preg_replace('/(<noscript[^>]*>|<\/noscript>)/msi', '', $this->html);
    133132    $this->html = preg_replace('~>\s+<~', '><', $this->html);
    134133    $this->html = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $this->html);
     
    464463      return $this->keywords;
    465464  }
     465
     466   public function isMediaExists(){
     467       $dom = new DOMDocument('1.0', 'UTF-8');
     468       @$dom->loadHTML($this->html);
     469       $xpath = new DomXPath($dom);
     470       $this->removeElementsByTagName('script', $dom);
     471       $this->removeElementsByTagName('style', $dom);
     472       $this->removeElementsByTagName('link', $dom);
     473       $imgTags = $xpath->query("//img");
     474       $img_array = array();
     475       foreach ($imgTags as $t) {
     476           $src = $t->getAttribute('src');
     477           $img_array[] = $src;
     478       }
     479       $obj = $xpath->query("//node()[(name()='iframe' or name()='video' or name()='source' or name()= 'object' or name()='embed') and (contains(@src,'youtube.com') or contains(@src ,'vimeo.com') or contains(@src,'youtu.be'))]");
     480       $videoArrays = array();
     481       foreach($obj as $objs){
     482           array_push($videoArrays,$objs->getAttribute('src'));
     483       }
     484       $mediaTags = array("images"=>count($img_array),"videos"=>count($videoArrays));
     485       return $mediaTags;
     486   }
    466487
    467488    function getTextBetweenTags($tag, $html, $strict=0)
  • expresscurate/trunk/ExpressCurate_Util.php

    r1106118 r1111122  
    2121
    2222
    23     public static function tmpname($postfix = '.tmp', $prefix = 'tmp', $dir = null) {
     23    public static function tmpname($prefix = 'tmp', $dir = null) {
    2424        // validate arguments
    25         if (! (isset($postfix) && is_string($postfix))) {
    26             return false;
    27         }
    2825        if (! (isset($prefix) && is_string($prefix))) {
    2926            return false;
     
    4037            }
    4138
    42             // tack on the extension
    43             $newFileName = $sysFileName . $postfix;
    44             if ($sysFileName == $newFileName) {
    45                 return $sysFileName;
    46             }
    47 
    48             $newFileCreated =  @link($sysFileName, $newFileName);
    49             if ($newFileCreated) {
    50                 return $newFileName;
    51             }
    52 
    53             unlink ($sysFileName);
    54         }catch (Exception $e){
     39            return $sysFileName;
     40        } catch (Exception $e) {
    5541            return false;
    5642        }
    57 
    58 
    59         return false;
    6043    }
    6144}
  • expresscurate/trunk/css/expresscurate.css

    r1109426 r1111122  
    669669            border-top: solid 1px #dddddd;
    670670        }
    671 
    672 .pageDesc{
    673     width: 56%;
    674 }
     671@media (max-width: 680px){
     672    .pageDesc{
     673        width: 100%;
     674    }
     675}
     676@media (min-width: 680px){
     677    .pageDesc{
     678        width: 60%;
     679    }
     680}
     681
     682
    675683
    676684.express_curate_selected_list_item {
     
    34893497      width: inherit;
    34903498}
    3491 @media (max-width:782px) {
     3499@media (max-width:600px) {
    34923500    .expresscurate_headBorderBottom .controlsWrap.fixedControls{
    34933501        top:0;
    34943502    }
    34953503}
    3496 @media (min-width:782px) {
     3504@media (min-width:600px) and (max-width: 782px){
     3505    .expresscurate_headBorderBottom .controlsWrap.fixedControls{
     3506        top:46px;
     3507    }
     3508}
     3509@media (min-width:782px){
    34973510    .expresscurate_headBorderBottom .controlsWrap.fixedControls{
    34983511        top:30px;
  • expresscurate/trunk/js/Dialog.js

    r1109426 r1111122  
    3131
    3232    function displayCuratedImages(images) {
    33         var $editor = $('.expresscurate_dialog .editor');
     33        var $editor = $('.expresscurate_dialog .editor'),
     34            count = images.length,
     35            validImgCount = 0,
     36            $counter = $('.expresscurate_dialog .imageCount');
    3437        $('.imgContainer').hide();
    3538        $editor.removeClass('small');
     
    4346                width = this.width;
    4447                if (width > 150 && height > 100) {
     48                    validImgCount++;
    4549                    var data = {
    4650                        index: index,
     
    4852                    };
    4953                    $('#curated_images').append(ExpressCurateUtils.getTemplate('dialogCuratedImage', data));
     54                    $counter.text('1/' + validImgCount).removeClass('expresscurate_displayNone');
    5055                    // show image container
    5156                    $editor.addClass('small');
     
    5459            };
    5560            img.src = value;
    56         });
    57         setTimeout(function () {
    58             var $curatedImages = $('ul#curated_images li'),
    59                 numberOfImages = $curatedImages.length,
    60                 $counter = $('.expresscurate_dialog .imageCount'),
    61                 errorHTML = '';
    62             if (numberOfImages > 0) {
    63                 $('.content .img').removeClass("noimage").css('background-image', $curatedImages.first().css('background-image'));
    64                 $counter.text('1/' + numberOfImages).removeClass('expresscurate_displayNone');
    65             } else {
    66                 errorHTML = '<div class="error">No image (of 120x100 or higher res) found in the original article.</div>';
    67                 $('#expresscurate_post_form').before(errorHTML);
    68             }
    69         }, 300);
    70     }
    71 
     61            if (index === images.length - 1) {
     62                setTimeout(function () {
     63                    var $curatedImages = $('ul#curated_images li'),
     64                        numberOfImages = $curatedImages.length,
     65                        errorHTML = '';
     66                    if (numberOfImages > 0) {
     67                        $('.content .img').removeClass("noimage").css('background-image', $curatedImages.first().css('background-image'));
     68                    } else {
     69                        errorHTML = '<div class="error">No image (of 120x100 or higher res) found in the original article.</div>';
     70                        $('#expresscurate_post_form').before(errorHTML);
     71                    }
     72                }, 300);
     73            }
     74        });
     75    }
    7276    function displayCuratedParagraphs(paragraphs, count, shortPar) {
    7377        var $paragraphsContainer = $('.paragraphs_preview'),
     
    148152            keywordsHTML += ExpressCurateUtils.getTemplate('dialogCuratedtags', data);
    149153        });
    150         keywordsHTML += ExpressCurateUtils.getTemplate('dialogMarkButton',null);
     154        keywordsHTML += ExpressCurateUtils.getTemplate('dialogMarkButton', null);
    151155        $("#curated_tags").append(keywordsHTML);
    152156    }
     
    169173        specialsHTML += displayCuratedHeadings(data.headings);
    170174        specialsHTML += displayCuratedDescription(data.metas.description);
    171         specialsHTML += ExpressCurateUtils.getTemplate('dialogSearchParagraphs',null);
     175        specialsHTML += ExpressCurateUtils.getTemplate('dialogSearchParagraphs', null);
    172176        if (specialsHTML.length === 0) {
    173177            specialsHTML += '<li>No specal data</li>';
     
    178182    function displayCuratedHeadings(headings) {
    179183        var headingsHTML = '';
    180         $.each(headings,function(index,value){
     184        $.each(headings, function (index, value) {
    181185            if (index && value.length > 0) {
    182                 var data={
    183                     index:index,
    184                     content:value
     186                var data = {
     187                    index: index,
     188                    content: value
    185189                };
    186                 headingsHTML += ExpressCurateUtils.getTemplate('dialogCuratedHeadings',data);
     190                headingsHTML += ExpressCurateUtils.getTemplate('dialogCuratedHeadings', data);
    187191            }
    188192        });
     
    193197        var descriptionHTML = '';
    194198        if (description && description.length > 0) {
    195             descriptionHTML += ExpressCurateUtils.getTemplate('dialogCuratedDescription',description);
     199            descriptionHTML += ExpressCurateUtils.getTemplate('dialogCuratedDescription', description);
    196200        }
    197201        return descriptionHTML;
     
    212216            paragraph += "</ul>";
    213217        } else {
    214             paragraph += "<" + tag + ">" + $('#'+ id).attr('title').replace(/\r\n/g, "<br />").replace(/\n/g, "<br />") + "</" + tag + "> &nbsp;";
     218            paragraph += "<" + tag + ">" + $('#' + id).attr('title').replace(/\r\n/g, "<br />").replace(/\n/g, "<br />") + "</" + tag + "> &nbsp;";
    215219        }
    216220        generateTags(paragraph);
  • expresscurate/trunk/js/keywords/SEOControlCenter.js

    r1109426 r1111122  
    9797            $addInput = $('.addKeywords input'),
    9898            $keywordWrap = $('.statisticsTitle span'),
    99             $description = $widgetWraper.find('.description'),
     99            $description = $('.expresscurate_widget .description'),
    100100            $descriptionContainer = $description.find('.descriptionWrap');
    101101
  • expresscurate/trunk/readme.txt

    r1109426 r1111122  
    55Requires at least: 3.9
    66Tested up to: 4.1
    7 Stable tag: 2.0.7
     7Stable tag: 2.0.8
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    8181
    8282= How To Get Started =
    83 [Download ExpressCurate plugin](http://downloads.wordpress.org/plugin/expresscurate.2.0.7.zip "Your favorite content marketing tools") for WordPress. 
     83[Download ExpressCurate plugin](http://downloads.wordpress.org/plugin/expresscurate.2.0.8.zip "Your favorite content marketing tools") for WordPress. 
    8484You can also [download](http://www.expresscurate.com/p/products/wordpress-theme "Your favorite WordPress Theme") a **free** [ExpressCurate WordPress theme](http://www.expresscurate.com/p/products/wordpress-theme "Your favorite WordPress Theme"). It will give your curated content a modern online news look.
    8585
     
    129129== Changelog ==
    130130
     131= 2.0.8 =
     132* The problem with temporary files flooding is fixed.
     133* Miscellaneous bug fixes and improvements.
     134
    131135= 2.0.7 =
    132136* Miscellaneous bug fixes and improvements.
  • expresscurate/trunk/templates/dashboard/feed_widget.php

    r1109426 r1111122  
    2424    </ul>
    2525    <?php  if(!empty($feeds) && !empty($feeds['content'])){ ?>
    26         <a class="settingsLink" href="admin.php?page=expresscurate_feed_list">More Content(<?php echo count($feeds['content']); ?>)</a>
     26        <a class="settingsLink" href="admin.php?page=expresscurate_feed_list">More Content (<?php echo count($feeds['content']); ?>)</a>
    2727    <?php  } ?>
    2828</div>
Note: See TracChangeset for help on using the changeset viewer.