├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── API.php
├── CHANGELOG-v0.md
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── IPtoCompany.php
├── LICENSE
├── Libraries
└── IPInfo.php
├── README.md
├── Reports
├── Base.php
└── GetCompanies.php
├── SystemSettings.php
├── Tasks.php
├── Updates
└── 0.2.0.php
├── UserSettings.php
├── config
├── config.php
└── tracker.php
├── data
└── countries.json
├── docs
├── faq.md
└── index.md
├── lang
├── am.json
├── ar.json
├── be.json
├── bg.json
├── bs.json
├── ca.json
├── cs.json
├── cy.json
├── da.json
├── de.json
├── el.json
├── en.json
├── es-ar.json
├── es.json
├── et.json
├── eu.json
├── fa.json
├── fi.json
├── fr.json
├── ga.json
├── gl.json
├── he.json
├── hi.json
├── hr.json
├── hu.json
├── id.json
├── is.json
├── it.json
├── ja.json
├── ka.json
├── ko.json
├── lt.json
├── lv.json
├── nb.json
├── nl.json
├── nn.json
├── pl.json
├── pt-br.json
├── pt.json
├── ro.json
├── ru.json
├── sk.json
├── sl.json
├── sq.json
├── sr.json
├── sv.json
├── ta.json
├── te.json
├── th.json
├── tl.json
├── tr.json
├── uk.json
├── ur.json
├── vi.json
├── zh-cn.json
└── zh-tw.json
├── plugin.json
├── screenshots
├── .gitkeep
├── full-view-of-the-report.png
├── list-of-ips-and-their-associated-company.png
└── user-setting-subscribe-to-email-report.png
└── stylesheets
└── iptocompany.less
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [romain]
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 |
--------------------------------------------------------------------------------
/API.php:
--------------------------------------------------------------------------------
1 | cacheLifeTimeForResults->getValue();
38 | $this->cacheLifeTimeForResults = $cacheLifeTimeForResults <= 0 ? 2 : $cacheLifeTimeForResults;
39 | $this->staticContainer = $staticContainer;
40 | }
41 |
42 | /**
43 | * Returns a data table with the visits.
44 | * @param int $idSite
45 | * @param string $period
46 | * @param string $date
47 | * @param bool|string $segment
48 | * @param int $filterLimit
49 | * @return DataTable
50 | */
51 | public function getCompanies($idSite, $period, $date, $segment = false, $filterLimit = 200)
52 | {
53 | Piwik::checkUserHasViewAccess($idSite);
54 |
55 | $logger = $this->staticContainer->getContainer()->get('Psr\Log\LoggerInterface');
56 |
57 | $response = Request::processRequest('Live.getLastVisitsDetails', [
58 | 'idSite' => $idSite,
59 | 'period' => $period,
60 | 'date' => $date,
61 | 'segment' => $segment,
62 | 'flat' => FALSE,
63 | 'doNotFetchActions' => FALSE,
64 | 'countVisitorsToFetch' => $filterLimit
65 | // 'token_auth' => $_ENV['AUTH_TOKEN']
66 | ]);
67 | $response->applyQueuedFilters();
68 |
69 | $result = $response->getEmptyClone($keepFilters = false);
70 |
71 | // Prepare an array containing the list of IP addresses to avoid multiple calls for the same IP address
72 | $ipList = [];
73 |
74 | // Get the list of IPs saved in the DB
75 | $dbList = \Piwik\API\Request::processRequest('IPtoCompany.getStoredCompanies', []);
76 |
77 | foreach ($response->getRows() as $visitRow) {
78 | $visitIp = $visitRow->getColumn('visitIp');
79 |
80 | // try and get the row in the result DataTable for the IP
81 | $ipRow = $result->getRowFromLabel($visitIp);
82 |
83 | // Get the company name based on the IP
84 | $ipList = $this->getIPDetails($visitIp, $ipList, $dbList);
85 | $companyName = $ipList[$visitIp];
86 |
87 | // if there is no row for this IP, create it
88 | if ($ipRow === false) {
89 | $result->addRowFromSimpleArray(array(
90 | 'IP' => $visitIp,
91 | 'company' => stripslashes($companyName),
92 | 'last_visit_time' => $visitRow->getColumn('lastActionDateTime'),
93 | 'type' => $visitRow->getColumn('visitorType'),
94 | 'nb_visits' => $visitRow->getColumn('visitCount'),
95 | 'last_visit_duration' => $visitRow->getColumn('visitDurationPretty'),
96 | 'referrer_type' => $visitRow->getColumn('referrerType'),
97 | 'referrer_name' => $visitRow->getColumn('referrerName'),
98 | 'device' => $visitRow->getColumn('deviceType'),
99 | 'country' => $visitRow->getColumn('country'),
100 | 'city' => $visitRow->getColumn('city'),
101 | ));
102 | }
103 |
104 | // if there is a row, increment the counter
105 | /*else {
106 | $counter = $ipRow->getColumn('nb_visits');
107 | $ipRow->setColumn('nb_visits', $counter + 1);
108 | }*/
109 | }
110 |
111 | return $result;
112 | }
113 |
114 |
115 | /**
116 | * Returns an array containing the IP and the company
117 | * @param string $period
118 | * @param string $date
119 | * @return array
120 | */
121 | public function getStoredCompanies()
122 | {
123 | $rows = NULL;
124 |
125 | try {
126 | $rows = Db::fetchAll("SELECT * FROM " . Common::prefixTable('ip_to_company'));
127 | } catch (Exception $e) {
128 | // ignore error if table already exists (1050 code is for 'table already exists')
129 | if (!Db::get()->isErrNo($e, '1050')) {
130 | throw $e;
131 | }
132 | }
133 |
134 | return $rows;
135 | }
136 |
137 |
138 | /**
139 | * Another example method that returns a data table.
140 | * @param string $ip
141 | * @return array
142 | */
143 | private function getIPDetails($ip, $ipList, $dbList)
144 | {
145 | $itemFound = FALSE;
146 | $companyName = NULL;
147 | $hostname = filter_var($ip, FILTER_VALIDATE_IP) ? gethostbyaddr($ip) : EMPTY_HOSTNAME;
148 |
149 | if(!isset($ipList[$ip])) {
150 | $delay = new \Datetime();
151 | $delay->sub(new \DateInterval('P' . $this->cacheLifeTimeForResults . 'W'));
152 |
153 | // Check if the IP address exists in the DB and if the record is younger than the defined cache
154 | foreach ($dbList as $item) {
155 | $itemDate = new \Datetime($item['updated_at']);
156 |
157 | if(($item['ip'] == $ip) && ($delay <= $itemDate)) {
158 | $ipList[$ip] = $item['as_name'];
159 | $itemFound = TRUE;
160 | }
161 | elseif(($item['ip'] == $ip) && ($itemDate < $delay)) {
162 | $companyDetails = $this->getCompanyDetails($ip);
163 | $companyName = $companyDetails['as_name'];
164 | $itemFound = $companyName ? TRUE : FALSE;
165 | $ipList[$ip] = $companyName ? $companyName : ($hostname === $ip ? EMPTY_HOSTNAME : $hostname);
166 |
167 | // We update the DB only if we got results from the getCompanyDetails method.
168 | if(($ipList[$ip] != $hostname) && $companyName) {
169 | $this->updateCompanyDetails($item, [
170 | 'as_number' => $companyDetails['as_number'],
171 | 'as_name' => $companyDetails['as_name']
172 | ]);
173 | }
174 | }
175 | }
176 | }
177 |
178 | // If the IP doesn't exist in the DB, and if it is a valid IP, try to get the details
179 | if(!isset($ipList[$ip]) && !$itemFound && filter_var($ip, FILTER_VALIDATE_IP)) {
180 | $companyDetails = $this->getCompanyDetails($ip);
181 | $companyName = $companyDetails['as_name'];
182 | $itemFound = $companyName ? TRUE : FALSE;
183 | $ipList[$ip] = $companyName ? $companyName : ($hostname === $ip ? EMPTY_HOSTNAME : $hostname);
184 |
185 | // We insert the item in the DB only if we got results from the getCompanyDetails method.
186 | if(($ipList[$ip] != $hostname) && $companyName) {
187 | $this->insertCompanyDetails([
188 | 'ip' => $ip,
189 | 'as_number' => $companyDetails['as_number'],
190 | 'as_name' => $companyDetails['as_name']
191 | ]);
192 | }
193 | }
194 |
195 | // If the IP is not valid, just return the empty hostname
196 | elseif(!filter_var($ip, FILTER_VALIDATE_IP)) {
197 | $ipList[$ip] = EMPTY_HOSTNAME;
198 | }
199 |
200 | return $ipList;
201 | }
202 |
203 |
204 | /**
205 | * Another example method that returns a data table.
206 | * @param string $ip
207 | * @return array
208 | */
209 | private function getCompanyDetails($ip)
210 | {
211 | $ipInfo = new IPInfo();
212 |
213 | // If no token has been set, stop here.
214 | if(!$ipInfo->accessToken) {
215 | return [
216 | "as_name" => NULL,
217 | "as_number" => NULL
218 | ];
219 | }
220 |
221 | try {
222 | $details = $ipInfo->getDetails($ip);
223 | } catch (\Exception $e) {
224 | return [
225 | "as_name" => NULL,
226 | "as_number" => NULL
227 | ];
228 | }
229 |
230 | $details = json_decode($details);
231 | $companyName = NULL;
232 | $asNumber = NULL;
233 |
234 | if(isset($details->company) && isset($details->company->name)) {
235 | $companyName = $details->company->name;
236 |
237 | if($details->company->domain) {
238 | $companyName .= " (" . $details->company->domain . ")";
239 | }
240 | }
241 | elseif(isset($details->org) && !isset($details->org->name)) {
242 | $orgElements = explode(" ", $details->org);
243 | $asNumber = array_shift($orgElements);
244 | $asName = count($orgElements) > 1 ? implode(" ", $orgElements) : $orgElements[0];
245 | $companyName = $asName;
246 | }
247 |
248 | return [
249 | "as_name" => $companyName,
250 | "as_number" => $asNumber
251 | ];
252 | }
253 |
254 | /**
255 | * A private methode to update the company details that we found in the DB
256 | * @param array $item
257 | * @param array $data
258 | * @return boolean
259 | */
260 | private function updateCompanyDetails($item, $data)
261 | {
262 | try {
263 | // If the server is running PHP 7.4.0 or newer
264 | if($this->isPHPVersionMoreRecentThan("7.4.0")) {
265 | $asName = filter_var($data['as_name'], FILTER_SANITIZE_ADD_SLASHES);
266 | }
267 | else {
268 | $asName = filter_var($data['as_name'], FILTER_SANITIZE_MAGIC_QUOTES);
269 | }
270 |
271 | $sql = "UPDATE " . Common::prefixTable('ip_to_company') . "
272 | SET as_number = '{$data['as_number']}', as_name = '{$asName}'
273 | WHERE id = {$item['id']}";
274 | Db::exec($sql);
275 | } catch (Exception $e) {
276 | throw $e;
277 | }
278 |
279 | return TRUE;
280 | }
281 |
282 | /**
283 | * A private methode to save the company details in the DB
284 | * @param array $data
285 | * @return boolean
286 | */
287 | private function insertCompanyDetails($data)
288 | {
289 | try {
290 | if($this->isPHPVersionMoreRecentThan("7.4.0")) {
291 | $asName = filter_var($data['as_name'], FILTER_SANITIZE_ADD_SLASHES);
292 | }
293 | else {
294 | $asName = filter_var($data['as_name'], FILTER_SANITIZE_MAGIC_QUOTES);
295 | }
296 | $sql = "INSERT INTO " . Common::prefixTable('ip_to_company') . "
297 | (ip, as_number, as_name) VALUES
298 | ('{$data['ip']}', '{$data['as_number']}', '{$asName}')";
299 | Db::exec($sql);
300 | } catch (Exception $e) {
301 | throw $e;
302 | }
303 |
304 | return TRUE;
305 | }
306 |
307 | /**
308 | * A private methode to save the company details in the DB
309 | * @param array $data
310 | * @return boolean
311 | */
312 | private function isPHPVersionMoreRecentThan($version)
313 | {
314 | $phpVersion = phpversion();
315 | $phpVersionParts = explode(".", $phpVersion);
316 | $phpMinVersionParts = explode(".", $version);
317 |
318 | if((int)$phpVersionParts[0] < (int)$phpMinVersionParts[0]) {
319 | return FALSE;
320 | }
321 | elseif((int)$phpVersionParts[1] < (int)$phpMinVersionParts[1]) {
322 | return FALSE;
323 | }
324 | elseif((int)$phpVersionParts[2] < (int)$phpMinVersionParts[2]) {
325 | return FALSE;
326 | }
327 |
328 | return TRUE;
329 | }
330 | }
331 |
--------------------------------------------------------------------------------
/CHANGELOG-v0.md:
--------------------------------------------------------------------------------
1 | ## Changelog
2 |
3 | ### 0.4.5
4 |
5 | *[2020-08-05]*
6 |
7 | - Merged [PR 7](https://github.com/Romain/Matomo-IP-to-Company/pull/7): German translation by [@Monschder](https://github.com/Romain/Matomo-IP-to-Company/commits?author=Monschder)
8 |
9 | ### 0.4.4
10 |
11 | *[2020-08-04]*
12 |
13 | - Merged [PR 6](https://github.com/Romain/Matomo-IP-to-Company/pull/6): Swedish translation by [@ljo](https://github.com/ljo)
14 |
15 | ### 0.4.3
16 |
17 | *[2020-06-08]*
18 |
19 | - Fixed a bug that occures when the user removes the IPinfo token.
20 |
21 | ### 0.4.2
22 |
23 | *[2020-05-20]*
24 |
25 | - Slightly change the scenario to display a dash if the IP is not valid.
26 |
27 | ### 0.4.1
28 |
29 | *[2020-05-20]*
30 |
31 | - Fixed a bug that occured when we tried to get the company details based on an IP that is not a valid IP address.
32 |
33 | ### 0.4.0
34 |
35 | *[2020-03-12]*
36 |
37 | - Creation of a parameter to set the lifetime of the cache according to the preferences of the user.
38 |
39 | ### 0.3.5
40 | ### 0.3.4
41 |
42 | *[2020-03-06]*
43 |
44 | - Bumping the version.
45 |
46 | ### 0.3.3
47 |
48 | *[2020-03-06]*
49 |
50 | - The superusers should not received the report if no user (including them) have agreed to receive it.
51 |
52 | ### 0.3.2
53 |
54 | *[2020-03-04]*
55 |
56 | - Increased the plugin version for the publication to work on the marketplace
57 |
58 | ### 0.3.1
59 |
60 | *[2020-03-04]*
61 |
62 | - Use the date of yesterday for the email report
63 |
64 | ### 0.3.0
65 |
66 | *[2020-03-03]*
67 |
68 | - Sends an email on a daily basis with the list of companies that visited the website the day before.
69 |
70 | ### 0.2.8
71 |
72 | *[2020-02-25]*
73 |
74 | - Commit the Changelog and the plugin.json with the tag
75 |
76 | ### 0.2.7
77 |
78 | *[2020-02-25]*
79 |
80 | - Conditionally apply FILTER_SANITIZE_MAGIC_QUOTES or FILTER_SANITIZE_ADD_SLASHES filters based on PHP version
81 |
82 | ### 0.2.6
83 |
84 | *[2020-01-07]*
85 |
86 | - Commit the Changelog and the plugin.json with the tag
87 |
88 | ### 0.2.5
89 |
90 | *[2020-01-07]*
91 |
92 | - Fixed the bug introduced by Matomo 1.13.1 when we gathered the visits using Live plugin API
93 | - Fixed the way we passed the data to the view (it was generating warnings)
94 | - Fixed the way we called the Exception class
95 |
96 | ### 0.2.4
97 |
98 | *[2020-01-07]*
99 |
100 | - Fixed a bug in the primary key definition in the migration
101 |
102 | ### 0.2.3
103 |
104 | *[2020-01-06]*
105 |
106 | - Update the plugin number in the JSON
107 |
108 | ### 0.2.2
109 |
110 | *[2020-01-06]*
111 |
112 | - Update the plugin number in the JSON
113 |
114 | ### 0.2.1
115 |
116 | *[2020-01-06]*
117 |
118 | - Create the table during installation and not activation.
119 |
120 | ### 0.2.0
121 |
122 | *[2020-01-06]*
123 |
124 | - Creation of an API endpoint to get the content of the table `ip_to_company`.
125 | - Cache the data gathered from IPInfo.io into the table during 1 week.
126 | - Creation of private methods to gather the content either from the table or from IPInfo.io.
127 | - Creation of a table `ip_to_company` upon activation.
128 | - Creation of a setting to store IPinfo.io access token.
129 |
130 | ### 0.1.7
131 |
132 | *[2020-01-06]*
133 |
134 | - Removed the `filter_sort_column` to avoid warnings with Matomo 3.13.1-b2.
135 |
136 | ### 0.1.6
137 |
138 | *[2020-01-02]*
139 |
140 | - Changed the default requirements
141 |
142 | ### 0.1.5
143 |
144 | *[2020-01-02]*
145 |
146 | - Rollback on the name of the plugin
147 |
148 | ### 0.1.4
149 |
150 | *[2020-01-02]*
151 |
152 | - Changed the default requirements
153 | - Changed the name of the plugin
154 |
155 | ### 0.1.3
156 |
157 | *[2020-01-02]*
158 |
159 | - Changed the default requirements
160 |
161 | ### 0.1.2
162 |
163 | *[2020-01-02]*
164 |
165 | - Fixed a bug in the plugin version in the JSON file
166 |
167 | ### 0.1.1
168 |
169 | *[2020-01-02]*
170 |
171 | - Improved the description of the plugin
172 |
173 | ### 0.1.0
174 |
175 | *[2020-01-02]*
176 |
177 | First working version of the plugin:
178 |
179 | - creation of a report in the `Visitors` tab, called `Companies` with the list of IPs that visited the website, and the company name associated
180 | - ability to add a widget to the dashboards with this report
181 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## Changelog
2 |
3 | ### 1.2.2
4 |
5 | *[2022-11-02]*
6 |
7 | - Fixing an issue in plugin.json
8 |
9 | ### 1.2.1
10 |
11 | *[2022-11-02]*
12 |
13 | - Added a donate section to the description of the plugin
14 |
15 | ### 1.2.0
16 |
17 | *[2022-05-17]*
18 |
19 | - PR #17 fixing issue #11: Translations using Weblate. Thanks to @comradekingu, @lourdas, @filhocf, @kayazeren, @sgiehl, @css31, @Findus23, raf, Ministry of Electronic Governance - Bulgaria, Taufik Adi Wicaksono and HO Gin Wang
20 |
21 | ### 1.1.0
22 |
23 | *[2022-05-17]*
24 |
25 | - PR #16 fixing issue #12: Improve performances of the schedule function by adding a $_GET parameter.
26 |
27 | ### 1.0.3
28 |
29 | *[2022-03-10]*
30 |
31 | - Required parameter $staticContainer should not follow optional parameters $settings (thanks @solracsf)
32 |
33 | ### 1.0.2
34 |
35 | *[2021-01-18]*
36 |
37 | - Catch some exceptions to avoid bugs if IPInfo encounters an error
38 |
39 | ### 1.0.1
40 |
41 | *[2020-10-14]*
42 |
43 | - Activated the pagination
44 |
45 | ### 1.0.0
46 |
47 | *[2020-10-13]*
48 |
49 | - Adapted the plugin for Matomo 4.0.0
50 |
51 | ## Previous Changelogs
52 |
53 | [v0.x](CHANGELOG-v0.md)
54 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at romain.biard@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/IPtoCompany.php:
--------------------------------------------------------------------------------
1 | isErrNo($e, '1050')) {
40 | throw $e;
41 | }
42 | }
43 | }
44 |
45 | /**
46 | * @see https://developer.matomo.org/guides/extending-database
47 | */
48 | public function activate()
49 | {
50 | try {
51 | $sql = "CREATE TABLE " . Common::prefixTable('ip_to_company') . " (
52 | id INTEGER NOT NULL AUTO_INCREMENT,
53 | ip VARCHAR( 15 ) NOT NULL ,
54 | as_number VARCHAR( 10 ) NULL ,
55 | as_name VARCHAR( 200 ) NULL ,
56 | created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ,
57 | updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
58 | PRIMARY KEY ( id )
59 | ) DEFAULT CHARSET=utf8 ";
60 | Db::exec($sql);
61 | } catch (Exception $e) {
62 | // ignore error if table already exists (1050 code is for 'table already exists')
63 | if (!Db::get()->isErrNo($e, '1050')) {
64 | throw $e;
65 | }
66 | }
67 | }
68 |
69 | /**
70 | * @see https://developer.matomo.org/guides/extending-database
71 | */
72 | public function uninstall()
73 | {
74 | Db::dropTables(Common::prefixTable('ip_to_company'));
75 | }
76 |
77 | /**
78 | * @see \Piwik\Plugin::registerEvents
79 | */
80 | public function registerEvents()
81 | {
82 | return array(
83 | //'AssetManager.getJavaScriptFiles' => 'getJsFiles',
84 | 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
85 | 'Widget.filterWidgets' => 'filterWidgets'
86 | );
87 | }
88 |
89 | public function getStylesheetFiles(&$stylesheets)
90 | {
91 | $stylesheets[] = "plugins/IPtoCompany/stylesheets/iptocompany.less";
92 | }
93 |
94 | /*public function getJsFiles(&$jsFiles)
95 | {
96 | $jsFiles[] = "libs/bower_components/iframe-resizer/js/iframeResizer.min.js";
97 |
98 | $jsFiles[] = "plugins/Marketplace/angularjs/plugins/plugin-name.directive.js";
99 | $jsFiles[] = "plugins/Marketplace/angularjs/licensekey/licensekey.controller.js";
100 | $jsFiles[] = "plugins/Marketplace/angularjs/marketplace/marketplace.controller.js";
101 | $jsFiles[] = "plugins/Marketplace/angularjs/marketplace/marketplace.directive.js";
102 | }*/
103 |
104 | /**
105 | * @param WidgetsList $list
106 | */
107 | public function filterWidgets($list)
108 | {
109 | if (!SettingsPiwik::isInternetEnabled()) {
110 | $list->remove('IPtoCompany_Companies');
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc. " . Piwik::translate('IPtoCompany_Hi') . " " . Piwik::translate('IPtoCompany_FindBelowCompaniesReport') . " "
182 | .""
183 | .""
184 | ."
IP "
185 | ."" . Piwik::translate('IPtoCompany_Company') . " "
186 | ."" . Piwik::translate('IPtoCompany_LastVisit') . " "
187 | ."" . Piwik::translate('IPtoCompany_Type') . " "
188 | ."" . Piwik::translate('IPtoCompany_NumberOfVisits') . " "
189 | ."" . Piwik::translate('IPtoCompany_LastVisitDuration') . " "
190 | ."" . Piwik::translate('IPtoCompany_ReferrerType') . " "
191 | ."" . Piwik::translate('IPtoCompany_ReferrerName') . " "
192 | ."" . Piwik::translate('IPtoCompany_Device') . " "
193 | ."" . Piwik::translate('IPtoCompany_Country') . " "
194 | ."" . Piwik::translate('IPtoCompany_City') . " "
195 | ."";
196 |
197 | foreach ($rows as $row) {
198 | $columns = $row->getColumns();
199 | $counter = 0;
200 | $nbColumns = count($columns);
201 |
202 | $html .= "";
203 |
204 | foreach ($columns as $key => $value) {
205 | $counter++;
206 | $styles = "border-bottom: solid 1px #DEDEDE;";
207 |
208 | if($counter < $nbColumns) {
209 | $styles .= " border-right: solid 1px #DEDEDE;";
210 | }
211 |
212 | $html .= " ";
216 | }
217 |
218 | $html .= "" . $value . " ";
213 | }
214 |
215 | $html .= "
" . Piwik::translate('IPtoCompany_NoOneVisitedWebsiteYesterday') . "
"; 222 | } 223 | 224 | $html .= "" . Piwik::translate('IPtoCompany_HaveANiceDay') . "
"; 226 | 227 | return $html; 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /Updates/0.2.0.php: -------------------------------------------------------------------------------- 1 | migration = $factory; 30 | } 31 | 32 | /** 33 | * Return database migrations to be executed in this update. 34 | * 35 | * Database migrations should be defined here, instead of in `doUpdate()`, since this method is used 36 | * in the `core:update` command when displaying the queries an update will run. If you execute 37 | * migrations directly in `doUpdate()`, they won't be displayed to the user. Migrations will be executed in the 38 | * order as positioned in the returned array. 39 | * 40 | * @param Updater $updater 41 | * @return Migration\Db[] 42 | */ 43 | public function getMigrations(Updater $updater) 44 | { 45 | // many different migrations are available to be used via $this->migration factory 46 | $migrationCreateTableIpToCompany = $this->migration->db->createTable('ip_to_company', [ 47 | 'id' => 'INTEGER NOT NULL AUTO_INCREMENT', 48 | 'ip' => 'VARCHAR( 15 ) NOT NULL', 49 | 'as_number' => 'VARCHAR( 10 ) NULL', 50 | 'as_name' => 'VARCHAR( 200 ) NULL', 51 | 'created_at' => 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', 52 | 'updated_at' => 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 53 | ], 'id'); 54 | // you can also define custom SQL migrations. If you need to bind parameters, use `->boundSql()` 55 | // $migration2 = $this->migration->db->sql($sqlQuery = 'SELECT 1'); 56 | 57 | return array( 58 | $migrationCreateTableIpToCompany 59 | ); 60 | } 61 | 62 | /** 63 | * Perform the incremental version update. 64 | * 65 | * This method should perform all updating logic. If you define queries in the `getMigrations()` method, 66 | * you must call {@link Updater::executeMigrations()} here. 67 | * 68 | * @param Updater $updater 69 | */ 70 | public function doUpdate(Updater $updater) 71 | { 72 | $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /UserSettings.php: -------------------------------------------------------------------------------- 1 | autoRefresh->getValue(); 25 | * $settings->color->getValue(); 26 | */ 27 | class UserSettings extends \Piwik\Settings\Plugin\UserSettings 28 | { 29 | protected function init() 30 | { 31 | // User setting --> checkbox converted to bool 32 | $this->subscribedToEmailReport = $this->createSubscribedToEmailReportSetting(); 33 | } 34 | 35 | private function createSubscribedToEmailReportSetting() 36 | { 37 | return $this->makeSetting('subscribedToEmailReport', $default = false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { 38 | $field->title = Piwik::translate('IPtoCompany_SubscribeToEmailReport'); 39 | $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; 40 | $field->description = Piwik::translate('IPtoCompany_WantToReceiveDailyReport'); 41 | // $field->validators[] = new NotEmpty(); 42 | }); 43 | } 44 | 45 | public function getSubscribedToEmailReportValueForUser($userLogin) 46 | { 47 | // Sanitize the user login 48 | $userLogin = filter_var($userLogin, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH); 49 | 50 | try { 51 | $sql = "SELECT * FROM " . Common::prefixTable('plugin_setting') . " 52 | WHERE plugin_name = 'IPtoCompany' 53 | AND setting_name = 'subscribedToEmailReport' 54 | AND setting_value = '1' 55 | AND user_login = '" . $userLogin . "'"; 56 | $result = Db::fetchAll($sql); 57 | } catch (Exception $e) { 58 | // ignore error if table already exists (1050 code is for 'table already exists') 59 | if (!Db::get()->isErrNo($e, '1050')) { 60 | throw $e; 61 | } 62 | } 63 | 64 | return count($result) == 1; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /config/config.php: -------------------------------------------------------------------------------- 1 | Personal Settings and check the checkbox located in the IPtoCompany section which asks you if you want to subscribe to this report. 30 | 31 | This report will then be sent to you once a day, for each site that you have access to, with the list of companies that visited your website the day before. 32 | 33 |  34 | 35 | __Can I define the lifetime of the cache?__ 36 | 37 | As of version 0.4.0, yes, you can. In the general settings section, you can set the number of weeks during which the results should be kept in cache. By default, we keep them 2 weeks, and the minimum is 1 week. 38 | 39 | __How many records are returned?__ 40 | 41 | By default, to guarantee the performance of the report, a maximum of 200 records are returned. You can increase this value by appending the following parameter to the URL: &filterLimit=300. 42 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ## Documentation 2 | 3 | Please consider reading our [FAQ](faq.md) first. 4 | 5 | If you want to **submit a bug**, please [create a new issue](https://github.com/Romain/Matomo-IP-to-Company/issues/new). 6 | 7 | If you want to **submit a new feature**, please [create a PR](https://github.com/Romain/Matomo-IP-to-Company/pulls). 8 | -------------------------------------------------------------------------------- /lang/am.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ar.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/be.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/bg.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Град", 4 | "Companies": "Компании", 5 | "CompaniesReportSubject": "[%1$s] Вашият дневен отчет / Компании", 6 | "Company": "Компания", 7 | "Country": "Държава", 8 | "Device": "Устройство", 9 | "FindBelowCompaniesReport": "По-долу ще намерите отчета на компаниите за вчерашния ден.", 10 | "HaveANiceDay": "Приятен ден!", 11 | "Hi": "Здравейте,", 12 | "LastVisit": "Последно посещение", 13 | "LastVisitDuration": "Продължителност на последното посещение", 14 | "LifeTimeOfCacheForResultsInWeeks": "Брой седмици, през които върнатите резултати трябва да се кешират.", 15 | "NoOneVisitedWebsiteYesterday": "Съжаляваме, но никой не посети уебсайта Ви вчера…", 16 | "NumberOfVisits": "Брой посещения", 17 | "PasteYourAccessToken": "Поставете в полето под токена си за достъп.", 18 | "ReferrerName": "Име на препращач", 19 | "ReferrerType": "Тип препращач", 20 | "SubscribeToEmailReport": "Абонирайте се за отчетите по имейл", 21 | "Type": "Тип", 22 | "WantToReceiveDailyReport": "Искам да получавам ежедневните отчети по имейл с името на компанията, която е посетила моите уебсайтове.", 23 | "YourIPInfoAccessToken": "Вашият токен за достъп до IPinfo.io" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/bs.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ca.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Ciutat", 4 | "Companies": "Empreses", 5 | "CompaniesReportSubject": "[%1$s] El vostre informe diari / Empreses", 6 | "Company": "Empresa", 7 | "Country": "País", 8 | "Device": "Dispositiu", 9 | "FindBelowCompaniesReport": "A continuació trobareu l'Informe d'Empreses d'ahir.", 10 | "HaveANiceDay": "Que tinguis un bon dia!", 11 | "Hi": "Bones,", 12 | "LastVisit": "Darrera visita", 13 | "LastVisitDuration": "Durada de la darrera visita", 14 | "LifeTimeOfCacheForResultsInWeeks": "Nombre de setmanes durant les quals els resultats retornats s'han d'emmagatzemar a la memòria cau.", 15 | "NoOneVisitedWebsiteYesterday": "Ens sap greu, però ahir ningú va visitar el vostre lloc web…", 16 | "NumberOfVisits": "Nombre de visites", 17 | "PasteYourAccessToken": "Enganxeu el vostre testimoni d'accés al camp que hi ha a sota.", 18 | "ReferrerName": "Nom del referent", 19 | "ReferrerType": "Tipus de referent", 20 | "SubscribeToEmailReport": "Subscriu-te als informes per correu electrònic", 21 | "Type": "Tipus", 22 | "WantToReceiveDailyReport": "Vull rebre els informes diaris per correu electrònic amb el nom de l'empresa que ha visitat els meus llocs web.", 23 | "YourIPInfoAccessToken": "El vostre testimoni d'accés proporcionat per IPinfo.io" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/cs.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/cy.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/da.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Stadt", 4 | "Companies": "Unternehmen", 5 | "CompaniesReportSubject": "[%1$s] Ihr täglicher Bericht / Unternehmen", 6 | "Company": "Unternehmen", 7 | "Country": "Land", 8 | "Device": "Gerät", 9 | "FindBelowCompaniesReport": "Nachfolgend finden Sie den Unternehmensbericht für den gestrigen Tag.", 10 | "HaveANiceDay": "Einen schönen Tag noch!", 11 | "Hi": "Hallo,", 12 | "LastVisit": "Letzter Besuch", 13 | "LastVisitDuration": "Dauer des letzten Besuchs", 14 | "LifeTimeOfCacheForResultsInWeeks": "Anzahl der Wochen, in denen die zurückgelieferten Ergebnisse zwischengespeichert werden müssen.", 15 | "NoOneVisitedWebsiteYesterday": "Es tut uns leid, aber niemand hat gestern Ihre Website besucht…", 16 | "NumberOfVisits": "Anzahl der Besuche", 17 | "PasteYourAccessToken": "Fügen Sie in das Feld unter Ihrem Zugangsschlüssel (Token) ein.", 18 | "ReferrerName": "Referrer Name", 19 | "ReferrerType": "Referrer Typ", 20 | "SubscribeToEmailReport": "Abonnieren Sie die E-Mail-Berichte", 21 | "Type": "Typ", 22 | "WantToReceiveDailyReport": "Ich möchte tägliche Berichte per E-Mail mit dem Namen des Unternehmens erhalten, das meine Websites besucht hat.", 23 | "YourIPInfoAccessToken": "Ihr IPinfo.io Zugangsschlüssel (Token)" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/el.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Πόλη", 4 | "Companies": "Εταιρίες", 5 | "CompaniesReportSubject": "[%1$s] Η καθημερινή σας αναφορά / Εταιρίες", 6 | "Company": "Εταιρία", 7 | "Country": "Χώρα", 8 | "Device": "Συσκευή", 9 | "FindBelowCompaniesReport": "Θα βρείτε παρακάτω την Αναφορά Εταιριών για την χθεσινή ημέρα.", 10 | "HaveANiceDay": "Σας ευχόμαστε μια ευχάριστη ημέρα!", 11 | "Hi": "Γεια σας,", 12 | "LastVisit": "Τελευταία επίσκεψη", 13 | "LastVisitDuration": "Διάρκεια τελευταίας επίσκεψης", 14 | "LifeTimeOfCacheForResultsInWeeks": "Αριθμός εβδομάδων για τις οποίες τα αποτελέσματα που επιστρέφονται θα αποθηκεύονται σε προσωρινή μνήμη.", 15 | "NoOneVisitedWebsiteYesterday": "Ζητούμε συγγνώμη, καθώς κανείς δεν επισκέφθηκε τον ιστοτόπο σας χθες…", 16 | "NumberOfVisits": "Αριθμός επισκέψεων", 17 | "PasteYourAccessToken": "Επικολλήστε στο πεδίο παρακάτω το τεκμήριο πρόσβασής σας.", 18 | "ReferrerName": "Όνομα αναφορέα", 19 | "ReferrerType": "Τύπος αναφορέα", 20 | "SubscribeToEmailReport": "Εγγραφείτε για αναφορές μέσω ηλεκτρονικής αλληλογραφίας", 21 | "Type": "Τύπος", 22 | "WantToReceiveDailyReport": "Θέλω να λαμβάνω τις καθημερινές αναφορές με ηλεκτρονική αλληλογραφία με το όνομα της εταιρίας που επισκέφτηκε τους ιστοτόπους μου.", 23 | "YourIPInfoAccessToken": "Το τεκμήριο πρόσβασής σας του IPinfo.io" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "City", 4 | "Companies": "Companies", 5 | "CompaniesReportSubject": "[%1$s] Your daily report / Companies", 6 | "Company": "Company", 7 | "Country": "Country", 8 | "Device": "Device", 9 | "FindBelowCompaniesReport": "You'll find below the Companies Report for the day of yesterday.", 10 | "HaveANiceDay": "Have a nice day!", 11 | "Hi": "Hi,", 12 | "LastVisit": "Last visit", 13 | "LastVisitDuration": "Last visit duration", 14 | "LifeTimeOfCacheForResultsInWeeks": "Number of weeks during which the results returned must be cached.", 15 | "NoOneVisitedWebsiteYesterday": "We are sorry, but no one visited your website yesterday…", 16 | "NumberOfVisits": "Number of visits", 17 | "PasteYourAccessToken": "Paste in the field below your access token.", 18 | "ReferrerName": "Referrer name", 19 | "ReferrerType": "Referrer type", 20 | "SubscribeToEmailReport": "Subscribe to the email reports", 21 | "Type": "Type", 22 | "WantToReceiveDailyReport": "I want to receive the daily reports by email with the name of the company that visited my websites.", 23 | "YourIPInfoAccessToken": "Your IPinfo.io access token" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/es-ar.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Ciudad", 4 | "Companies": "Empresas", 5 | "CompaniesReportSubject": "[%1$s] Su informe cotidiano / Empresas", 6 | "Company": "Empresa", 7 | "Country": "País", 8 | "Device": "Soporte", 9 | "FindBelowCompaniesReport": "Pueden encontrar abajo el informe con la lista de empresas que visitaron su sitio web ayer.", 10 | "HaveANiceDay": "Le deseamos un buen día!", 11 | "Hi": "Hola,", 12 | "LastVisit": "Última visita", 13 | "LastVisitDuration": "Duración de la última visita", 14 | "LifeTimeOfCacheForResultsInWeeks": "Numero de semanas durante cuales los resultados proveídos tienen que estar guardados en la memoria caché.", 15 | "NoOneVisitedWebsiteYesterday": "Lo sentimos mucho, pero nadie vino a visitar su sitio web ayer…", 16 | "NumberOfVisits": "Número de visitas", 17 | "PasteYourAccessToken": "Pega al lado su ficha de acceso.", 18 | "ReferrerName": "Nombre de la fuente", 19 | "ReferrerType": "Tipo de fuente", 20 | "SubscribeToEmailReport": "Suscribete a los informes", 21 | "Type": "Tipo", 22 | "WantToReceiveDailyReport": "Quiero recibir los informes cotidianos por email con la lista de empresas que visitaron mis sitios web.", 23 | "YourIPInfoAccessToken": "Su ficha de acceso de IPinfo.io" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/et.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/eu.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/fa.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/fi.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Ville", 4 | "Companies": "Sociétés", 5 | "CompaniesReportSubject": "[%1$s] Votre rapport quotidien / Sociétés", 6 | "Company": "Société", 7 | "Country": "Pays", 8 | "Device": "Support", 9 | "FindBelowCompaniesReport": "Vous trouverez ci-dessous le rapport avec la liste des sociétés qui ont visité votre site hier.", 10 | "HaveANiceDay": "Bonne journée !", 11 | "Hi": "Bonjour,", 12 | "LastVisit": "Dernière visite", 13 | "LastVisitDuration": "Durée de la dernière visite", 14 | "LifeTimeOfCacheForResultsInWeeks": "Nombre de semaines pendant lesquelles les résultats retournés doivent être gardés en cache.", 15 | "NoOneVisitedWebsiteYesterday": "Nous sommes désolé, mais personne n'a visité votre site hier…", 16 | "NumberOfVisits": "Nombre de visites", 17 | "PasteYourAccessToken": "Collez dans le champ ci-contre votre code d'accès.", 18 | "ReferrerName": "Nom de la source", 19 | "ReferrerType": "Type de source", 20 | "SubscribeToEmailReport": "Abonnez-vous aux rapports par e-mail", 21 | "Type": "Type", 22 | "WantToReceiveDailyReport": "Je veux recevoir des rapports quotidiens par email avec la liste des sociétés qui ont visité mes sites web.", 23 | "YourIPInfoAccessToken": "Votre jeton d'accès fourni par IPinfo.io" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/ga.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/gl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/he.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/hi.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/hr.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/hu.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/id.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Kota", 4 | "Companies": "Perusahaan", 5 | "CompaniesReportSubject": "[%1$s] Laporan harian Anda/Perusahaan", 6 | "Company": "Perusahaan", 7 | "Country": "Negara", 8 | "Device": "Perangkat", 9 | "FindBelowCompaniesReport": "Anda akan menemukan Laporan Perusahaan untuk hari kemarin di bawah ini.", 10 | "HaveANiceDay": "Semoga hari Anda menyenangkan!", 11 | "Hi": "Hai,", 12 | "LastVisit": "Kunjungan terakhir", 13 | "LastVisitDuration": "Durasi kunjungan terakhir", 14 | "LifeTimeOfCacheForResultsInWeeks": "Jumlah minggu di mana hasil yang dikembalikan harus disimpan.", 15 | "NoOneVisitedWebsiteYesterday": "Kami minta maaf, tidak ada yang mengunjungi situs web Anda kemarin…", 16 | "NumberOfVisits": "Jumlah kunjungan", 17 | "PasteYourAccessToken": "Tempel token akses Anda di kolom di bawah ini.", 18 | "ReferrerName": "Nama perujuk", 19 | "ReferrerType": "Tipe perujuk", 20 | "SubscribeToEmailReport": "Berlangganan laporan surel", 21 | "Type": "Tipe", 22 | "WantToReceiveDailyReport": "Saya ingin menerima laporan harian melalui surel dengan nama perusahaan yang mengunjungi situs web saya.", 23 | "YourIPInfoAccessToken": "Token akses IPinfo.io Anda" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/is.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Città", 4 | "Companies": "Aziende", 5 | "CompaniesReportSubject": "[%1$s] Il tuo rapporto quotidiano / Aziende", 6 | "Company": "Azienda", 7 | "Country": "Stato", 8 | "Device": "Dispositivo", 9 | "FindBelowCompaniesReport": "Di seguito trovate il Rapporto Aziende per la giornata di ieri.", 10 | "HaveANiceDay": "Buona giornata!", 11 | "Hi": "Ciao,", 12 | "LastVisit": "Ultima visita", 13 | "LastVisitDuration": "Durata ultima visita", 14 | "LifeTimeOfCacheForResultsInWeeks": "Numero di settimane durante le quali i risultati restituiti devono essere memorizzati nella cache.", 15 | "NoOneVisitedWebsiteYesterday": "Siamo spiacenti, ma nessuno ha visitato il tuo sito web ieri…" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lang/ja.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ka.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ko.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/lt.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/lv.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/nb.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "By", 4 | "Companies": "Bedrifter", 5 | "CompaniesReportSubject": "[%1$s] Din daglige rapport/bedrifter", 6 | "Company": "Bedrift", 7 | "Country": "Land", 8 | "Device": "Enhet", 9 | "FindBelowCompaniesReport": "Nedenfor finner du bedriftsrapporten for gårsdagen.", 10 | "HaveANiceDay": "Ha en fin dag.", 11 | "Hi": "Hei,", 12 | "LastVisit": "Siste besøk", 13 | "LastVisitDuration": "Varighet for siste besøk", 14 | "LifeTimeOfCacheForResultsInWeeks": "Antall uker der svarresultat må hurtiglagres.", 15 | "NoOneVisitedWebsiteYesterday": "Ingen besøkte nettsiden din i dag …", 16 | "NumberOfVisits": "Antall besøk", 17 | "PasteYourAccessToken": "Lim inn tilgangssymbolet ditt i feltet nedenfor.", 18 | "ReferrerName": "Henvisernavn", 19 | "ReferrerType": "Henvisningstype", 20 | "SubscribeToEmailReport": "Abonner på e-postrapportene", 21 | "Type": "Type", 22 | "WantToReceiveDailyReport": "Jeg ønsker daglig rapportering per e-post med navnene til bedriftene som har besøkt nettsidene mine.", 23 | "YourIPInfoAccessToken": "Ditt IPinfo.io-tilgangssymbol" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/nl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/nn.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/pl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/pt-br.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Cidade", 4 | "Companies": "Empresas", 5 | "CompaniesReportSubject": "[%1$s] Seu relatório diário / Empresas", 6 | "Company": "Empresa", 7 | "Country": "País", 8 | "Device": "Dispositivo", 9 | "FindBelowCompaniesReport": "Você encontrará abaixo o Relatório de Empresas para o dia de ontem.", 10 | "HaveANiceDay": "Tenha um bom dia!", 11 | "Hi": "Olá,", 12 | "LastVisit": "Última visita", 13 | "LastVisitDuration": "Duração da última visita", 14 | "LifeTimeOfCacheForResultsInWeeks": "Número de semanas durante as quais os resultados retornados devem ser armazenados em cache.", 15 | "NoOneVisitedWebsiteYesterday": "Lamentamos, mas ninguém visitou seu site ontem…", 16 | "NumberOfVisits": "Número de visitas", 17 | "PasteYourAccessToken": "Cole no campo abaixo do seu token de acesso.", 18 | "ReferrerName": "Nome do referenciador", 19 | "ReferrerType": "Tipo de referenciador", 20 | "SubscribeToEmailReport": "Assine os relatórios de e-mail", 21 | "Type": "Tipo", 22 | "WantToReceiveDailyReport": "Quero receber os relatórios diários por e-mail com o nome da empresa que visitou meus sites.", 23 | "YourIPInfoAccessToken": "Seu token de acesso IPinfo.io" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/pt.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ro.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ru.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sk.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sq.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sr.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/sv.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "Stad", 4 | "Companies": "Företag/domäner", 5 | "CompaniesReportSubject": "[%1$s] Daglig rapport företag/domäner", 6 | "Company": "Företag", 7 | "Country": "Land", 8 | "Device": "Enhet", 9 | "FindBelowCompaniesReport": "Företag/domäner-rapporten för igår.", 10 | "HaveANiceDay": "Ha en bra dag!", 11 | "Hi": "Hej,", 12 | "LastVisit": "Senaste besök", 13 | "LastVisitDuration": "Längd på senaste besök", 14 | "LifeTimeOfCacheForResultsInWeeks": "Antal veckor som resultaten sparas i cachen.", 15 | "NoOneVisitedWebsiteYesterday": "Inga besök på sajten igår …", 16 | "NumberOfVisits": "Antal besök", 17 | "PasteYourAccessToken": "Fyll i din access-token i fältet nedan.", 18 | "ReferrerName": "Hänvisningsnamn", 19 | "ReferrerType": "Hänvisningstyp", 20 | "SubscribeToEmailReport": "Prenumerera på e-postrapporter", 21 | "Type": "Typ", 22 | "WantToReceiveDailyReport": "Jag vill få dagliga rapporter via e-post om företag/domäner som besökt sajterna.", 23 | "YourIPInfoAccessToken": "Din IPinfo.io access-token" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/ta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/te.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/th.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/tl.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/tr.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "İl", 4 | "Companies": "Kuruluşlar", 5 | "CompaniesReportSubject": "[%1$s] günlük raporunuz / kuruluşlar", 6 | "Company": "Kuruluş", 7 | "Country": "Ülke", 8 | "Device": "Aygıt", 9 | "FindBelowCompaniesReport": "Düne ait kuruluşlar raporunu aşağıda bulabilirsiniz.", 10 | "HaveANiceDay": "İyi günler!", 11 | "Hi": "Merhaba,", 12 | "LastVisit": "Son ziyaret", 13 | "LastVisitDuration": "Son ziyaret süresi", 14 | "LifeTimeOfCacheForResultsInWeeks": "Döndürülen sonuçların ön belleğe alınacağı hafta sayısı.", 15 | "NoOneVisitedWebsiteYesterday": "Maalesef, dün hiç kimse web sitenizi ziyaret etmemiş…", 16 | "NumberOfVisits": "Ziyaret sayısı", 17 | "PasteYourAccessToken": "Erişim kodunun altındaki alana yapıştırın.", 18 | "ReferrerName": "Yönlendiren adı", 19 | "ReferrerType": "Yönlendiren türü", 20 | "SubscribeToEmailReport": "E-posta raporlarına abone ol", 21 | "Type": "Tür", 22 | "WantToReceiveDailyReport": "Web sitelerimi ziyaret eden kuruluşun adıyla e-posta ile günlük raporlar almak istiyorum.", 23 | "YourIPInfoAccessToken": "IPinfo.io erişim kodunuz" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lang/uk.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/ur.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/vi.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/zh-cn.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /lang/zh-tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "IPtoCompany": { 3 | "City": "城市", 4 | "Companies": "公司", 5 | "CompaniesReportSubject": "[%1$s] 你的每日報表 / 公司", 6 | "Company": "公司", 7 | "Country": "國家與地區", 8 | "Device": "裝置", 9 | "FindBelowCompaniesReport": "你可以在下方找到昨天的公司報表。", 10 | "HaveANiceDay": "祝你有個愉快的一天!", 11 | "Hi": "你好,", 12 | "LastVisit": "上次訪問", 13 | "LastVisitDuration": "上次訪問時長", 14 | "LifeTimeOfCacheForResultsInWeeks": "返回結果的週數時段必須被緩存。", 15 | "NoOneVisitedWebsiteYesterday": "抱歉,昨天沒有人訪問你的網站…", 16 | "NumberOfVisits": "訪問次數", 17 | "PasteYourAccessToken": "粘貼到存取權杖下方的欄位中。", 18 | "ReferrerName": "引薦來源名稱", 19 | "ReferrerType": "引薦來源類型", 20 | "SubscribeToEmailReport": "訂閱 Email 報表", 21 | "Type": "類型", 22 | "WantToReceiveDailyReport": "我想透過 Email 接收包含訪問過我網站的公司名稱的每日報表。", 23 | "YourIPInfoAccessToken": "你的 IPinfo.io 存取權杖" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "IPtoCompany", 3 | "description": "Get the name of the companies that visit your website.", 4 | "version": "1.2.2", 5 | "theme": false, 6 | "stylesheet": "stylesheets/iptocompany.less", 7 | "require": { 8 | "matomo": ">=4.0.0-b1,<5.0.0-b1" 9 | }, 10 | "authors": [ 11 | { 12 | "name": "Romain Biard", 13 | "email": "romain.biard@gmail.com", 14 | "homepage": "https:\/\/www.linkedin.com\/in\/rbiard\/" 15 | } 16 | ], 17 | "support": { 18 | "email": "romain.biard@gmail.com", 19 | "issues": "https:\/\/github.com\/Romain\/Matomo-IP-to-Company\/issues", 20 | "forum": "https:\/\/forum.matomo.org", 21 | "wiki": "https:\/\/github.com\/Romain\/Matomo-IP-to-Company\/wiki", 22 | "source": "https:\/\/github.com\/Romain\/Matomo-IP-to-Company" 23 | }, 24 | "homepage": "https:\/\/github.com\/Romain\/Matomo-IP-to-Company", 25 | "license": "GPL v3+", 26 | "keywords": [ 27 | "ip", 28 | "company", 29 | "report", 30 | "companies" 31 | ], 32 | "donate": { 33 | "paypal": "romain.biard@gmail.com" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /screenshots/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Romain/Matomo-IP-to-Company/e309dfe470cbf84c98280f47558b4b1b59b7458f/screenshots/.gitkeep -------------------------------------------------------------------------------- /screenshots/full-view-of-the-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Romain/Matomo-IP-to-Company/e309dfe470cbf84c98280f47558b4b1b59b7458f/screenshots/full-view-of-the-report.png -------------------------------------------------------------------------------- /screenshots/list-of-ips-and-their-associated-company.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Romain/Matomo-IP-to-Company/e309dfe470cbf84c98280f47558b4b1b59b7458f/screenshots/list-of-ips-and-their-associated-company.png -------------------------------------------------------------------------------- /screenshots/user-setting-subscribe-to-email-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Romain/Matomo-IP-to-Company/e309dfe470cbf84c98280f47558b4b1b59b7458f/screenshots/user-setting-subscribe-to-email-report.png -------------------------------------------------------------------------------- /stylesheets/iptocompany.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Romain/Matomo-IP-to-Company/e309dfe470cbf84c98280f47558b4b1b59b7458f/stylesheets/iptocompany.less --------------------------------------------------------------------------------