Plugin Directory

Changeset 1591202


Ignore:
Timestamp:
02/07/2017 05:04:37 PM (9 years ago)
Author:
Tunapanda
Message:

fix related to SSL certificates in Windows

Location:
wp-repo-tracker/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-repo-tracker/trunk

    • Property svn:ignore
      •  

        old new  
        11.git
        22.gitmodules
         3.gitignore
        34submodule
  • wp-repo-tracker/trunk/src/plugin/RepoTrackerPlugin.php

    r1583266 r1591202  
    1818        register_uninstall_hook($pluginFileName,array($this,"uninstall"));
    1919
    20         //register_deactivation_hook($pluginFileName,array($this,"uninstall"));
     20        IssueFilter::register();
    2121
    22         IssueFilter::register();
     22        add_filter("register_kpis",array($this,"registerKpis"));
     23        add_filter("measure_kpis",array($this,"measureKpis"));
    2324    }
    2425
     
    4445    }
    4546
     47    /**
     48     * Register kpis for the wp-data-kpis plugin.
     49     */
     50    public function registerKpis($kpis) {
     51        $issueFitlers=IssueFilter::getAllPublished();
     52
     53        foreach ($issueFitlers as $issueFilter) {
     54            $kpis[$issueFilter->getPost()->post_name]=array(
     55                "title"=>$issueFilter->getPost()->post_title
     56            );
     57        }
     58
     59        return $kpis;
     60    }
     61
     62    /**
     63     * Measure the current kpis for the benefit of the wp-data-kpis plugin.
     64     */
     65    public function measureKpis($kpis) {
     66        $issueFitlers=IssueFilter::getAllPublished();
     67
     68        foreach ($issueFitlers as $issueFilter) {
     69            $kpis[$issueFilter->getPost()->post_name]=
     70                $issueFilter->getNumIssues();
     71        }
     72
     73        return $kpis;
     74    }
    4675}
  • wp-repo-tracker/trunk/src/utils/CurlRequest.php

    r1583266 r1591202  
    9393        ));
    9494
     95        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
     96        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
     97
    9598        curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE);
    9699        curl_setopt($curl,CURLOPT_FOLLOWLOCATION,TRUE);
  • wp-repo-tracker/trunk/src/utils/PostTypeModel.php

    r1583266 r1591202  
    22
    33namespace repotracker;
     4
     5use \WP_Query;
     6use \Exception;
    47
    58/**
     
    1720    private final function __construct($post) {
    1821        $this->post=$post;
     22    }
     23
     24    /**
     25     * Get underlying post.
     26     */
     27    public function getPost() {
     28        return $this->post;
    1929    }
    2030
     
    7282
    7383    /**
     84     * Get all published posts of this posttype.
     85     */
     86    public static function getAllPublished() {
     87        if (!static::$posttype)
     88            throw new Exception("Post type not set in subclass");
     89
     90        $q=new WP_Query(array(
     91            "post_type"=>static::$posttype,
     92            "post_status"=>"publish",
     93            "posts_per_page"=>-1
     94        ));
     95
     96        $all=array();
     97        foreach ($q->get_posts() as $post)
     98            $all[]=new static($post);
     99
     100        return $all;
     101    }
     102
     103    /**
    74104     * Called when a post is saved.
    75105     * Override in subclass.
  • wp-repo-tracker/trunk/wp-repo-tracker.php

    r1583266 r1591202  
    55GitHub Plugin URI: https://bitbucket.org/tunapanda/wp-repo-tracker
    66Description: Track issues from a code repository, and show them on your WordPress site.
    7 Version: 0.0.1
     7Version: 0.0.2
    88*/
    99
Note: See TracChangeset for help on using the changeset viewer.